From 1ede9b8f6cb79acf3146b7b2273dccd8b0c930d9 Mon Sep 17 00:00:00 2001 From: Dipesh Acharya Date: Sat, 17 Dec 2011 22:14:03 +0545 Subject: [PATCH] removed timeout on extension disabling --- extension.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/extension.js b/extension.js index d1af881..70dcd70 100644 --- a/extension.js +++ b/extension.js @@ -6,6 +6,7 @@ const Main = imports.ui.main; const GLib = imports.gi.GLib; //const Gio = imports.gi.Gio; const Util = imports.misc.util; +const Mainloop = imports.mainloop; //gnome 3.0 const Panel = imports.ui.panel; @@ -50,7 +51,7 @@ CpuTemperature.prototype = { this._update_temp(); //update every 15 seconds - GLib.timeout_add_seconds(0, 15, Lang.bind(this, function () { + event = GLib.timeout_add_seconds(0, 15, Lang.bind(this, function () { this._update_temp(); return true; })); @@ -373,6 +374,7 @@ function main() { } let indicator; +let event=null; function enable() { indicator = new CpuTemperature(); @@ -381,5 +383,6 @@ function enable() { function disable() { indicator.destroy(); - indicator = null; +Mainloop.source_remove(event); +indicator = null; }