aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-chat.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2009-02-18 18:27:34 +0800
committerXavier Claessens <xclaesse@gmail.com>2009-04-22 18:21:12 +0800
commitb8484ca5a72d50253a4ec86c79b188dfd46265ab (patch)
tree1e237e84c714662190a8933bd49dc0c064b6f2a9 /libempathy-gtk/empathy-chat.c
parent3ef84ad2da98454cae8241e24a6a605c77e31830 (diff)
downloadgsoc2013-empathy-b8484ca5a72d50253a4ec86c79b188dfd46265ab.tar
gsoc2013-empathy-b8484ca5a72d50253a4ec86c79b188dfd46265ab.tar.gz
gsoc2013-empathy-b8484ca5a72d50253a4ec86c79b188dfd46265ab.tar.bz2
gsoc2013-empathy-b8484ca5a72d50253a4ec86c79b188dfd46265ab.tar.lz
gsoc2013-empathy-b8484ca5a72d50253a4ec86c79b188dfd46265ab.tar.xz
gsoc2013-empathy-b8484ca5a72d50253a4ec86c79b188dfd46265ab.tar.zst
gsoc2013-empathy-b8484ca5a72d50253a4ec86c79b188dfd46265ab.zip
Disconnect all signals from tp_chat when the UI is destroyed
Diffstat (limited to 'libempathy-gtk/empathy-chat.c')
-rw-r--r--libempathy-gtk/empathy-chat.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 6b2fb1ebd..985eaa4cf 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -65,7 +65,6 @@
#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyChat)
typedef struct {
EmpathyTpChat *tp_chat;
- gulong tp_chat_destroy_handler;
McAccount *account;
gchar *id;
gchar *name;
@@ -1436,7 +1435,20 @@ chat_finalize (GObject *object)
g_object_unref (priv->log_manager);
if (priv->tp_chat) {
- g_signal_handler_disconnect (priv->tp_chat, priv->tp_chat_destroy_handler);
+ g_signal_handlers_disconnect_by_func (priv->tp_chat,
+ chat_destroy_cb, chat);
+ g_signal_handlers_disconnect_by_func (priv->tp_chat,
+ chat_message_received_cb, chat);
+ g_signal_handlers_disconnect_by_func (priv->tp_chat,
+ chat_send_error_cb, chat);
+ g_signal_handlers_disconnect_by_func (priv->tp_chat,
+ chat_state_changed_cb, chat);
+ g_signal_handlers_disconnect_by_func (priv->tp_chat,
+ chat_property_changed_cb, chat);
+ g_signal_handlers_disconnect_by_func (priv->tp_chat,
+ chat_members_changed_cb, chat);
+ g_signal_handlers_disconnect_by_func (priv->tp_chat,
+ chat_remote_contact_changed_cb, chat);
empathy_tp_chat_close (priv->tp_chat);
g_object_unref (priv->tp_chat);
}
@@ -1629,6 +1641,9 @@ empathy_chat_set_tp_chat (EmpathyChat *chat,
connection);
g_object_ref (priv->account);
+ g_signal_connect (tp_chat, "destroy",
+ G_CALLBACK (chat_destroy_cb),
+ chat);
g_signal_connect (tp_chat, "message-received",
G_CALLBACK (chat_message_received_cb),
chat);
@@ -1647,10 +1662,6 @@ empathy_chat_set_tp_chat (EmpathyChat *chat,
g_signal_connect_swapped (tp_chat, "notify::remote-contact",
G_CALLBACK (chat_remote_contact_changed_cb),
chat);
- priv->tp_chat_destroy_handler =
- g_signal_connect (tp_chat, "destroy",
- G_CALLBACK (chat_destroy_cb),
- chat);
chat_remote_contact_changed_cb (chat);