empathy r1096 - trunk/libempathy
- From: xclaesse svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r1096 - trunk/libempathy
- Date: Fri, 9 May 2008 09:06:19 +0100 (BST)
Author: xclaesse
Date: Fri May 9 08:06:19 2008
New Revision: 1096
URL: http://svn.gnome.org/viewvc/empathy?rev=1096&view=rev
Log:
Don't leak queued messages if EmpathyTpChat gets finalized.
Modified:
trunk/libempathy/empathy-tp-chat.c
Modified: trunk/libempathy/empathy-tp-chat.c
==============================================================================
--- trunk/libempathy/empathy-tp-chat.c (original)
+++ trunk/libempathy/empathy-tp-chat.c Fri May 9 08:06:19 2008
@@ -834,6 +834,8 @@
EmpathyTpChatPriv *priv = GET_PRIV (object);
guint i;
+ DEBUG ("Finalize: %p", object);
+
if (priv->acknowledge && priv->channel) {
DEBUG ("Closing channel...");
tp_cli_channel_call_close (priv->channel, -1,
@@ -875,6 +877,19 @@
g_object_unref (priv->account);
g_free (priv->id);
+ if (priv->message_queue) {
+ EmpathyMessage *message;
+ EmpathyContact *contact;
+
+ message = priv->message_queue->data;
+ contact = empathy_message_get_sender (message);
+ g_signal_handlers_disconnect_by_func (contact,
+ tp_chat_sender_ready_notify_cb,
+ object);
+ }
+ g_slist_foreach (priv->message_queue, (GFunc) g_object_unref, NULL);
+ g_slist_free (priv->message_queue);
+
G_OBJECT_CLASS (empathy_tp_chat_parent_class)->finalize (object);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]