From 82ee2cfb806cd91b6a58a1e3d4cceabbe736ee5a Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Sat, 13 Feb 2010 16:44:39 +0000 Subject: Don't reinvent g_slist_foreach --- libempathy-gtk/empathy-chat.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'libempathy-gtk/empathy-chat.c') diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index 5702adb70..4594d4d29 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -2954,9 +2954,7 @@ empathy_chat_messages_read (EmpathyChat *self) /* ...else, we can't do any acknowledging because the channel (or * indeed connection) has gone away. */ - while (priv->pending_messages != NULL) { - g_object_unref (priv->pending_messages->data); - priv->pending_messages = g_slist_delete_link ( - priv->pending_messages, priv->pending_messages); - } + g_slist_foreach (priv->pending_messages, (GFunc) g_object_unref, NULL); + g_slist_free (priv->pending_messages); + priv->pending_messages = NULL; } -- cgit v1.2.3