Remove timer resource during SignalMgt destructor
This commit is contained in:
parent
78254a550e
commit
02d3e8b72a
12
extension.js
12
extension.js
|
@ -62,8 +62,9 @@ class SignalMgt {
|
||||||
this.fullname = this.name + '@' + this.group;
|
this.fullname = this.name + '@' + this.group;
|
||||||
this.dbus = dbus;
|
this.dbus = dbus;
|
||||||
this.menu = menu;
|
this.menu = menu;
|
||||||
this.signals = new WeakMap();
|
this.signals = new WeakMap();
|
||||||
this.widgets = new Array();
|
this.widgets = new Array();
|
||||||
|
this.timeouts = new Array();
|
||||||
|
|
||||||
this.nbClicks = 0;
|
this.nbClicks = 0;
|
||||||
this.button = -1;
|
this.button = -1;
|
||||||
|
@ -80,6 +81,8 @@ class SignalMgt {
|
||||||
destructor() {
|
destructor() {
|
||||||
for(let widgetIdx in this.widgets)
|
for(let widgetIdx in this.widgets)
|
||||||
this.disconnectWidgetSignals(this.widgets[widgetIdx]);
|
this.disconnectWidgetSignals(this.widgets[widgetIdx]);
|
||||||
|
for(let timeoutIdx in this.timeouts)
|
||||||
|
GLib.Source.remove(this.timeouts[timeoutIdx]);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateSignals(item) {
|
updateSignals(item) {
|
||||||
|
@ -168,8 +171,9 @@ class SignalMgt {
|
||||||
this.button = event.get_button();
|
this.button = event.get_button();
|
||||||
this.nbClicks = 1;
|
this.nbClicks = 1;
|
||||||
|
|
||||||
Mainloop.timeout_add(this.dbus.ClutterSettings['double-click-time'],
|
let sourceId = Mainloop.timeout_add(this.dbus.ClutterSettings['double-click-time'],
|
||||||
this._doClickCallback.bind(this));
|
this._doClickCallback.bind(this));
|
||||||
|
this.timeouts.push(sourceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Clutter.EVENT_PROPAGATE;
|
return Clutter.EVENT_PROPAGATE;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user