[gnome-maps] geoclue: Only remove timeout source if active
- From: Jonas Danielsson <jonasdn src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] geoclue: Only remove timeout source if active
- Date: Tue, 10 Feb 2015 19:48:33 +0000 (UTC)
commit b7f5fd3fe99853c4a4004dff31b8c61a6b65eee4
Author: Jonas Danielsson <jonas threetimestwo org>
Date: Tue Feb 10 20:47:49 2015 +0100
geoclue: Only remove timeout source if active
src/geoclue.js | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/geoclue.js b/src/geoclue.js
index 975ea26..cb5bb41 100644
--- a/src/geoclue.js
+++ b/src/geoclue.js
@@ -196,8 +196,10 @@ const Geoclue = new Lang.Class({
accuracy: geoclueLocation.Accuracy,
description: geoclueLocation.Description });
this._updateLocation(location);
- Mainloop.source_remove(this._timeoutId);
- this._timeoutId = 0;
+ if (this._timeoutId !== 0) {
+ Mainloop.source_remove(this._timeoutId);
+ this._timeoutId = 0;
+ }
this.state = State.ON;
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]