appIndicator: Remove the callbackIdle if we destroy while waiting it
Marco Trevisan (TreviƱo)
3 years ago
330 | 330 | this.connect('destroy', () => { |
331 | 331 | this._iconCache.destroy(); |
332 | 332 | this._cancellable.cancel(); |
333 | ||
334 | if (this._callbackIdle) { | |
335 | GLib.source_remove(this._callbackIdle); | |
336 | delete this._callbackIdle; | |
337 | } | |
333 | 338 | }); |
334 | 339 | } |
335 | 340 | |
404 | 409 | |
405 | 410 | _createIconByName(path, callback) { |
406 | 411 | if (!path) { |
407 | GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => { | |
412 | this._callbackIdle = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => { | |
413 | delete this._callbackIdle; | |
408 | 414 | callback(null); |
409 | 415 | return false; |
410 | 416 | }); |