mirror of
https://github.com/morgan9e/gnome-shell-extension-freon
synced 2026-04-15 00:44:22 +09:00
removed timeout on extension disabling
This commit is contained in:
@@ -6,6 +6,7 @@ const Main = imports.ui.main;
|
|||||||
const GLib = imports.gi.GLib;
|
const GLib = imports.gi.GLib;
|
||||||
//const Gio = imports.gi.Gio;
|
//const Gio = imports.gi.Gio;
|
||||||
const Util = imports.misc.util;
|
const Util = imports.misc.util;
|
||||||
|
const Mainloop = imports.mainloop;
|
||||||
//gnome 3.0
|
//gnome 3.0
|
||||||
const Panel = imports.ui.panel;
|
const Panel = imports.ui.panel;
|
||||||
|
|
||||||
@@ -50,7 +51,7 @@ CpuTemperature.prototype = {
|
|||||||
|
|
||||||
this._update_temp();
|
this._update_temp();
|
||||||
//update every 15 seconds
|
//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();
|
this._update_temp();
|
||||||
return true;
|
return true;
|
||||||
}));
|
}));
|
||||||
@@ -373,6 +374,7 @@ function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let indicator;
|
let indicator;
|
||||||
|
let event=null;
|
||||||
|
|
||||||
function enable() {
|
function enable() {
|
||||||
indicator = new CpuTemperature();
|
indicator = new CpuTemperature();
|
||||||
@@ -381,5 +383,6 @@ function enable() {
|
|||||||
|
|
||||||
function disable() {
|
function disable() {
|
||||||
indicator.destroy();
|
indicator.destroy();
|
||||||
indicator = null;
|
Mainloop.source_remove(event);
|
||||||
|
indicator = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user