From cf3051996cb579dd3f696a3b5a7bd3b4bc58e46a Mon Sep 17 00:00:00 2001 From: Jens Lody Date: Mon, 18 Sep 2017 06:44:35 +0200 Subject: [PATCH] Avoid "Source ID xxx was not found when attempting to remove it"-errors. --- src/extension.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/extension.js b/src/extension.js index 4dfeb23..2ee948f 100644 --- a/src/extension.js +++ b/src/extension.js @@ -521,6 +521,11 @@ const OpenweatherMenuButton = new Lang.Class({ this._connected = false; this._timeoutCheckConnectionState = Mainloop.timeout_add(interval, Lang.bind(this, function() { + // Delete (undefine) the variable holding the timeout-id, otherwise we can get errors, if we try to delete + // it manually, the timeout will be destroyed automatically if we return false. + // We just fetch it for the rare case, where the connection chages or the extension will be stopped during + // the timeout. + this._timeoutCheckConnectionState = undefined; let url = this.getWeatherProviderURL(); let address = Gio.NetworkAddress.parse_uri(url, 80); let cancellable = Gio.Cancellable.new();