diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-07 00:47:57 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-07 00:47:57 +0800 |
commit | a7da89d2a228975ee1c2df2c0aa0206123692c32 (patch) | |
tree | 037e4b382df70ed1659928c1456e06eb1d510bec /libempathy | |
parent | f3571f23063cebdea9e7c3fb0fa91e40c82cdaca (diff) | |
download | gsoc2013-empathy-a7da89d2a228975ee1c2df2c0aa0206123692c32.tar gsoc2013-empathy-a7da89d2a228975ee1c2df2c0aa0206123692c32.tar.gz gsoc2013-empathy-a7da89d2a228975ee1c2df2c0aa0206123692c32.tar.bz2 gsoc2013-empathy-a7da89d2a228975ee1c2df2c0aa0206123692c32.tar.lz gsoc2013-empathy-a7da89d2a228975ee1c2df2c0aa0206123692c32.tar.xz gsoc2013-empathy-a7da89d2a228975ee1c2df2c0aa0206123692c32.tar.zst gsoc2013-empathy-a7da89d2a228975ee1c2df2c0aa0206123692c32.zip |
Always disconnect signals for safety on _finalize ().
svn path=/trunk/; revision=2062
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-account-manager.c | 21 | ||||
-rw-r--r-- | libempathy/empathy-contact-manager.c | 5 |
2 files changed, 24 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); diff --git a/libempathy/empathy-contact-manager.c b/libempathy/empathy-contact-manager.c index 315ea2c7a..2e50a53bd 100644 --- a/libempathy/empathy-contact-manager.c +++ b/libempathy/empathy-contact-manager.c @@ -185,7 +185,12 @@ contact_manager_finalize (GObject *object) contact_manager_disconnect_foreach, object); g_hash_table_destroy (priv->lists); + + g_signal_handlers_disconnect_by_func (priv->account_manager, + contact_manager_connection_changed_cb, + object); g_object_unref (priv->account_manager); + g_object_unref (priv->contact_monitor); } |