aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-account-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy/empathy-account-manager.c')
-rw-r--r--libempathy/empathy-account-manager.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/libempathy/empathy-account-manager.c b/libempathy/empathy-account-manager.c
index 5859d26c0..2eab490ac 100644
--- a/libempathy/empathy-account-manager.c
+++ b/libempathy/empathy-account-manager.c
@@ -341,8 +341,23 @@ empathy_account_manager_init (EmpathyAccountManager *manager)
dbus_g_proxy_connect_signal (DBUS_G_PROXY (priv->mc), "AccountStatusChanged",
G_CALLBACK (account_status_changed_cb),
- g_object_ref (manager),
- (GClosureNotify) g_object_unref);
+ manager, NULL);
+}
+
+static void
+disconnect_monitor_signals (McAccountMonitor *monitor,
+ GObject *obj)
+{
+ g_signal_handlers_disconnect_by_func (monitor,
+ account_created_cb, obj);
+ g_signal_handlers_disconnect_by_func (monitor,
+ account_deleted_cb, obj);
+ g_signal_handlers_disconnect_by_func (monitor,
+ account_disabled_cb, obj);
+ g_signal_handlers_disconnect_by_func (monitor,
+ account_enabled_cb, obj);
+ g_signal_handlers_disconnect_by_func (monitor,
+ account_changed_cb, obj);
}
static void
@@ -356,6 +371,8 @@ do_finalize (GObject *obj)
G_CALLBACK (account_status_changed_cb),
obj);
+ disconnect_monitor_signals (priv->monitor, obj);
+
g_object_unref (priv->monitor);
g_object_unref (priv->mc);