aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-chat-window.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-05-05 04:28:07 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-05-05 04:28:07 +0800
commitd4b7387bd9e75435b2d8c26e5bef028ddf17960c (patch)
treea909f2d75f117d2e964ed77450f64c59fb49b148 /src/empathy-chat-window.c
parentd95ca9143ce2117d2b08c4b8ca210a0ab3f804a1 (diff)
downloadgsoc2013-empathy-d4b7387bd9e75435b2d8c26e5bef028ddf17960c.tar
gsoc2013-empathy-d4b7387bd9e75435b2d8c26e5bef028ddf17960c.tar.gz
gsoc2013-empathy-d4b7387bd9e75435b2d8c26e5bef028ddf17960c.tar.bz2
gsoc2013-empathy-d4b7387bd9e75435b2d8c26e5bef028ddf17960c.tar.lz
gsoc2013-empathy-d4b7387bd9e75435b2d8c26e5bef028ddf17960c.tar.xz
gsoc2013-empathy-d4b7387bd9e75435b2d8c26e5bef028ddf17960c.tar.zst
gsoc2013-empathy-d4b7387bd9e75435b2d8c26e5bef028ddf17960c.zip
Avoid copying chat list in chat_window_delete_event_cb.
svn path=/trunk/; revision=1079
Diffstat (limited to 'src/empathy-chat-window.c')
-rw-r--r--src/empathy-chat-window.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 82dfdd662..bb8960479 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -707,21 +707,15 @@ chat_window_delete_event_cb (GtkWidget *dialog,
GdkEvent *event,
EmpathyChatWindow *window)
{
- EmpathyChatWindowPriv *priv;
- GList *list;
- GList *l;
-
- priv = GET_PRIV (window);
+ EmpathyChatWindowPriv *priv = GET_PRIV (window);
DEBUG ("Delete event received");
- list = g_list_copy (priv->chats);
-
- for (l = list; l; l = l->next) {
- empathy_chat_window_remove_chat (window, l->data);
+ g_object_ref (window);
+ while (priv->chats) {
+ empathy_chat_window_remove_chat (window, priv->chats->data);
}
-
- g_list_free (list);
+ g_object_unref (window);
return TRUE;
}