From 2e45c0e8a06a72ad25b87b8b58a7dfeb29263d20 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 21 Sep 2011 20:37:30 +0100 Subject: [PATCH] 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 deletion(-) 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 -- 2.7.4