Disconnect network monitor if the extension gets stopped.

multiprovider
Jens Lody 11 years ago
parent 62090c48c5
commit 8bb7406ba9
  1. 7
      src/extension.js

@ -291,7 +291,7 @@ const WeatherMenuButton = new Lang.Class({
this._network_monitor = Gio.network_monitor_get_default();
this._connected = false;
this._network_monitor.connect('network-changed', Lang.bind(this, this._onNetworkStateChanged));
this._network_monitor_connection = this._network_monitor.connect('network-changed', Lang.bind(this, this._onNetworkStateChanged));
this._checkConnectionState();
this.menu.connect('open-state-changed', Lang.bind(this, this._onOpenStateChanged));
@ -308,6 +308,11 @@ const WeatherMenuButton = new Lang.Class({
this._timeoutForecast = undefined;
if (this._network_monitor_connection) {
this._network_monitor.disconnect(this._network_monitor_connection);
this._network_monitor_connection = undefined;
}
if (this._settingsC) {
this._settings.disconnect(this._settingsC);
this._settingsC = undefined;

Loading…
Cancel
Save