aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2009-01-10 00:13:11 +0800
committerxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2009-01-10 00:13:11 +0800
commitf728742587bef6ebe33565439aba4ae3a539ffba (patch)
treee60f081bf4826d4b3f4185e29ace77d3a437a84d /libempathy
parent256561f9899c5619b6f05d30ba13d4748e10f3c6 (diff)
downloadgsoc2013-empathy-f728742587bef6ebe33565439aba4ae3a539ffba.tar
gsoc2013-empathy-f728742587bef6ebe33565439aba4ae3a539ffba.tar.gz
gsoc2013-empathy-f728742587bef6ebe33565439aba4ae3a539ffba.tar.bz2
gsoc2013-empathy-f728742587bef6ebe33565439aba4ae3a539ffba.tar.lz
gsoc2013-empathy-f728742587bef6ebe33565439aba4ae3a539ffba.tar.xz
gsoc2013-empathy-f728742587bef6ebe33565439aba4ae3a539ffba.tar.zst
gsoc2013-empathy-f728742587bef6ebe33565439aba4ae3a539ffba.zip
Disconnect signal handlers from the head of the queue before destroying the queue
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@2147 4ee84921-47dd-4033-b63a-18d7a039a3e4
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-tp-chat.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index 77b56bfc0..2ac483061 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -914,6 +914,16 @@ tp_chat_dispose (GObject *object)
g_object_unref (priv->account);
priv->account = NULL;
+ if (g_queue_get_length (priv->messages_queue) > 0) {
+ EmpathyMessage *message;
+ EmpathyContact *contact;
+
+ message = g_queue_peek_head (priv->messages_queue);
+ contact = empathy_message_get_sender (message);
+ g_signal_handlers_disconnect_by_func (contact,
+ tp_chat_sender_ready_notify_cb, object);
+ }
+
g_list_foreach (priv->messages_queue->head, (GFunc) g_object_unref, NULL);
g_queue_free (priv->messages_queue);
@@ -964,17 +974,6 @@ tp_chat_finalize (GObject *object)
g_object_unref (priv->account);
g_free (priv->id);
- if (g_queue_get_length (priv->messages_queue) > 0) {
- EmpathyMessage *message;
- EmpathyContact *contact;
-
- message = g_queue_peek_head (priv->messages_queue);
- contact = empathy_message_get_sender (message);
- g_signal_handlers_disconnect_by_func (contact,
- tp_chat_sender_ready_notify_cb,
- object);
- }
-
G_OBJECT_CLASS (empathy_tp_chat_parent_class)->finalize (object);
}