may fix a bug
This commit is contained in:
+13
-7
@@ -212,10 +212,13 @@ export default class ICESpeedExtension extends Extension {
|
||||
/*
|
||||
* Only now do we create a repeating timer.
|
||||
*/
|
||||
this._timerId = GLib.timeout_add_seconds(
|
||||
this._timerId = GLib.timeout_add(
|
||||
GLib.PRIORITY_DEFAULT,
|
||||
UPDATE_INTERVAL_SECONDS,
|
||||
UPDATE_INTERVAL_SECONDS * 1000,
|
||||
() => {
|
||||
if (!this._onIceWifi)
|
||||
return GLib.SOURCE_REMOVE;
|
||||
|
||||
this._updateSpeed();
|
||||
return GLib.SOURCE_CONTINUE;
|
||||
}
|
||||
@@ -240,16 +243,19 @@ export default class ICESpeedExtension extends Extension {
|
||||
/*
|
||||
* Cancel an in-progress curl invocation.
|
||||
*/
|
||||
if (this._requestCancellable !== null)
|
||||
this._requestCancellable.cancel();
|
||||
|
||||
if (this._requestProcess !== null)
|
||||
this._requestProcess.force_exit();
|
||||
const cancellable = this._requestCancellable;
|
||||
const process = this._requestProcess;
|
||||
|
||||
this._requestCancellable = null;
|
||||
this._requestProcess = null;
|
||||
this._requestRunning = false;
|
||||
|
||||
if (cancellable !== null)
|
||||
cancellable.cancel();
|
||||
|
||||
if (process !== null)
|
||||
process.force_exit();
|
||||
|
||||
/*
|
||||
* Completely disappear from panel.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user