diff options
-rw-r--r-- | libempathy-gtk/empathy-chat.c | 3 | ||||
-rw-r--r-- | libempathy-gtk/empathy-contact-list-store.c | 27 | ||||
-rw-r--r-- | libempathy/empathy-account-manager.c | 21 | ||||
-rw-r--r-- | libempathy/empathy-contact-manager.c | 5 |
4 files changed, 54 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index 35b91f876..606eb3d18 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -1392,6 +1392,9 @@ chat_finalize (GObject *object) chat_composing_remove_timeout (chat); + g_signal_handlers_disconnect_by_func (priv->account_manager, + chat_connection_changed_cb, object); + g_object_unref (priv->account_manager); g_object_unref (priv->log_manager); diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c index 38a7aeaad..dba27df53 100644 --- a/libempathy-gtk/empathy-contact-list-store.c +++ b/libempathy-gtk/empathy-contact-list-store.c @@ -143,6 +143,8 @@ static gboolean contact_list_store_update_list_mode_foreach (GtkTreeMod GtkTreeIter *iter, EmpathyContactListStore *store); static gboolean contact_list_store_iface_setup (gpointer user_data); +static void disconnect_monitor_signals (EmpathyContactMonitor *monitor, + GObject *obj); enum { PROP_0, @@ -249,6 +251,10 @@ static void contact_list_store_finalize (GObject *object) { EmpathyContactListStorePriv *priv = GET_PRIV (object); + EmpathyContactMonitor *monitor; + + monitor = empathy_contact_list_get_monitor (priv->list); + disconnect_monitor_signals (monitor, object); g_signal_handlers_disconnect_by_func (priv->list, G_CALLBACK (contact_list_store_groups_changed_cb), @@ -1067,6 +1073,27 @@ contact_monitor_contact_removed_cb (EmpathyContactMonitor *monitor, contact_list_store_remove_contact (store, contact); } + +static void +disconnect_monitor_signals (EmpathyContactMonitor *monitor, + GObject *obj) +{ + g_signal_handlers_disconnect_by_func (monitor, + contact_monitor_avatar_changed_cb, obj); + g_signal_handlers_disconnect_by_func (monitor, + contact_monitor_capabilities_changed_cb, obj); + g_signal_handlers_disconnect_by_func (monitor, + contact_monitor_contact_added_cb, obj); + g_signal_handlers_disconnect_by_func (monitor, + contact_monitor_contact_removed_cb, obj); + g_signal_handlers_disconnect_by_func (monitor, + contact_monitor_name_changed_cb, obj); + g_signal_handlers_disconnect_by_func (monitor, + contact_monitor_presence_changed_cb, obj); + g_signal_handlers_disconnect_by_func (monitor, + contact_monitor_presence_message_changed_cb, obj); +} + static gboolean contact_list_store_iface_setup (gpointer user_data) { 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); } |