From d4b7387bd9e75435b2d8c26e5bef028ddf17960c Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Sun, 4 May 2008 20:28:07 +0000 Subject: Avoid copying chat list in chat_window_delete_event_cb. svn path=/trunk/; revision=1079 --- src/empathy-chat-window.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3