diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2008-05-09 16:06:19 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-05-09 16:06:19 +0800 |
commit | 43b0a7422d36fce70e7af66460a27fa22b97a36c (patch) | |
tree | 2bc6521429f3f4ee590c99e210df652b3722a6d9 | |
parent | b161e626aa0e40e3793d4d9391292706fb76cdaf (diff) | |
download | gsoc2013-empathy-43b0a7422d36fce70e7af66460a27fa22b97a36c.tar gsoc2013-empathy-43b0a7422d36fce70e7af66460a27fa22b97a36c.tar.gz gsoc2013-empathy-43b0a7422d36fce70e7af66460a27fa22b97a36c.tar.bz2 gsoc2013-empathy-43b0a7422d36fce70e7af66460a27fa22b97a36c.tar.lz gsoc2013-empathy-43b0a7422d36fce70e7af66460a27fa22b97a36c.tar.xz gsoc2013-empathy-43b0a7422d36fce70e7af66460a27fa22b97a36c.tar.zst gsoc2013-empathy-43b0a7422d36fce70e7af66460a27fa22b97a36c.zip |
Don't leak queued messages if EmpathyTpChat gets finalized.
svn path=/trunk/; revision=1096
-rw-r--r-- | libempathy/empathy-tp-chat.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c index f0d7820a9..286896bbe 100644 --- a/libempathy/empathy-tp-chat.c +++ b/libempathy/empathy-tp-chat.c @@ -834,6 +834,8 @@ tp_chat_finalize (GObject *object) 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 @@ tp_chat_finalize (GObject *object) 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); } |