diff --git a/extension.js b/extension.js index 171ebd3..8e0de0b 100644 --- a/extension.js +++ b/extension.js @@ -62,8 +62,9 @@ class SignalMgt { this.fullname = this.name + '@' + this.group; this.dbus = dbus; this.menu = menu; - this.signals = new WeakMap(); - this.widgets = new Array(); + this.signals = new WeakMap(); + this.widgets = new Array(); + this.timeouts = new Array(); this.nbClicks = 0; this.button = -1; @@ -80,6 +81,8 @@ class SignalMgt { destructor() { for(let widgetIdx in this.widgets) this.disconnectWidgetSignals(this.widgets[widgetIdx]); + for(let timeoutIdx in this.timeouts) + GLib.Source.remove(this.timeouts[timeoutIdx]); } updateSignals(item) { @@ -168,8 +171,9 @@ class SignalMgt { this.button = event.get_button(); this.nbClicks = 1; - Mainloop.timeout_add(this.dbus.ClutterSettings['double-click-time'], - this._doClickCallback.bind(this)); + let sourceId = Mainloop.timeout_add(this.dbus.ClutterSettings['double-click-time'], + this._doClickCallback.bind(this)); + this.timeouts.push(sourceId); } return Clutter.EVENT_PROPAGATE;