From a08aa838849eb92b3277bf946e8e48e9af9952d1 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 12 Sep 2025 11:58:58 +0800 Subject: [PATCH] bugfix --- bricks/wterm.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bricks/wterm.js b/bricks/wterm.js index 77c687d..e17fafe 100644 --- a/bricks/wterm.js +++ b/bricks/wterm.js @@ -18,8 +18,13 @@ bricks.Wterm = class extends bricks.JsWidget { this.bind('domoff', this.destroy.bind(this)); } destroy(){ - console.debug('------domoff event, destory this wdiget'); + this.unbind('element_resize', this.term_resize.bind(this)) + this.heartbeat_task.cancel(); + this.heartbeat_task = null; + console.debug('------domoff event, destory this widget'); if (this.socket){ + console.log('socket alive, destroy it'); + this.socket.send(JSON.stringify({ type: "close"})); this.socket.close(1,'close now'); this.socket.onopen = null; this.socket.onmessage = null;