[folks] telepathy: Fix finalisation of Tpf.Logger if it hasn't been prepared



commit 2e45c0e8a06a72ad25b87b8b58a7dfeb29263d20
Author: Philip Withnall <philip tecnocode co uk>
Date:   Wed Sep 21 20:37:30 2011 +0100

    telepathy: Fix finalisation of Tpf.Logger if it hasn't been prepared
    
    Closes: bgo#659585

 NEWS                                   |    2 ++
 backends/telepathy/lib/tpf-logger.vala |    6 +++++-
 2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index b14fe55..6bce4a5 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ Bugs fixed:
 * Bug 662314 â Gnome-shell restarts if I change my user status to
   disconnected/unavailable
 * Bug 663798 â Add AbstractFieldDetails.value_type
+* Bug 659585 â GLib-GIO-CRITICAL **: g_bus_unwatch_name: assertion
+  `watcher_id > 0' failed
 
 API changes:
 * Add AbstractFieldDetails.id to identify instances of details
diff --git a/backends/telepathy/lib/tpf-logger.vala b/backends/telepathy/lib/tpf-logger.vala
index e249a82..a114913 100644
--- a/backends/telepathy/lib/tpf-logger.vala
+++ b/backends/telepathy/lib/tpf-logger.vala
@@ -60,7 +60,11 @@ internal class Logger : GLib.Object
 
   ~Logger ()
     {
-      Bus.unwatch_name (this._logger_watch_id);
+      /* Can only be 0 if prepare() hasn't been called. */
+      if (this._logger_watch_id > 0)
+        {
+          Bus.unwatch_name (this._logger_watch_id);
+        }
     }
 
   public async bool prepare () throws GLib.Error



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]