]> git.0d.be Git - empathy.git/commitdiff
Disconnect signal handlers from the head of the queue before destroying the queue
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Fri, 9 Jan 2009 16:13:11 +0000 (16:13 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Fri, 9 Jan 2009 16:13:11 +0000 (16:13 +0000)
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
svn path=/trunk/; revision=2147

libempathy/empathy-tp-chat.c

index 77b56bfc0951d07d154742e8b954f921fd6ec6e9..2ac483061f84ce2b22fc6cf48a04162eef790035 100644 (file)
@@ -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);
 }