[gnome-settings-daemon] gconf: Disconnect callbacks when cleaning up



commit 28146a6b453eef450acfbdda7172246f9b8b0036
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Tue Sep 13 10:57:17 2011 +0200

    gconf: Disconnect callbacks when cleaning up

 plugins/gconf/conf-watcher.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/plugins/gconf/conf-watcher.c b/plugins/gconf/conf-watcher.c
index 99a148d..e569818 100644
--- a/plugins/gconf/conf-watcher.c
+++ b/plugins/gconf/conf-watcher.c
@@ -23,13 +23,19 @@
 
 G_DEFINE_TYPE(ConfWatcher, conf_watcher, G_TYPE_OBJECT)
 
+static void settings_changed_cb (GSettings *settings,
+                                 const gchar *key,
+                                 ConfWatcher *watcher);
+
 static void
 conf_watcher_finalize (GObject *object)
 {
 	ConfWatcher *watcher = CONF_WATCHER (object);
 
-	if (watcher->settings != NULL)
+	if (watcher->settings != NULL) {
+                g_signal_handlers_disconnect_by_func (watcher->settings, settings_changed_cb, watcher);
 		g_object_unref (watcher->settings);
+        }
 
 	if (watcher->conf_client != NULL)
 		g_object_unref (watcher->conf_client);



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