systemMonitor: Properly enable/disable

https://bugzilla.gnome.org/show_bug.cgi?id=662705
This commit is contained in:
Jasper St. Pierre
2011-10-25 14:21:01 -04:00
parent 4c5a36e4c0
commit 2bba98d621

View File

@@ -35,13 +35,18 @@ Indicator.prototype = {
reactive: true});
this.actor.add_actor(this.drawing_area);
Mainloop.timeout_add(INDICATOR_UPDATE_INTERVAL, Lang.bind(this, function () {
this._timeout = Mainloop.timeout_add(INDICATOR_UPDATE_INTERVAL, Lang.bind(this, function () {
this._updateValues();
this.drawing_area.queue_repaint();
return true;
}));
},
destroy: function() {
Mainloop.source_remove(this._timeout);
this.actor.destroy();
},
_initValues: function() {
},
@@ -239,6 +244,8 @@ function enable() {
function disable() {
_cpuIndicator.destroy();
_cpuIndicator = null;
_memIndicator.destroy();
_memIndicator = null;
_box.destroy();
}