]> git.0d.be Git - empathy.git/commitdiff
Don't reinvent g_slist_foreach
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Sat, 13 Feb 2010 16:44:39 +0000 (16:44 +0000)
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>
Sat, 13 Feb 2010 17:13:23 +0000 (17:13 +0000)
libempathy-gtk/empathy-chat.c

index 5702adb7075f2ed4deea93e315ecebf28ce718c5..4594d4d29a7b6f8fae93016a1d7bf3933c93d9ef 100644 (file)
@@ -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;
 }