[Spice-commits] gtk/glib-compat.c

Christophe Fergau teuf at kemper.freedesktop.org
Tue Aug 20 01:37:13 PDT 2013


 gtk/glib-compat.c |   15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

New commits:
commit 5cbef32ca6ed83426bf0797a46593f53f5f70476
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Mon Aug 19 17:35:08 2013 +0200

    Use g_slist_foreach_full glib implementation
    
    For the compat case (glib < 2.28), we were using our own implementation
    instead of directly reusing glib code.

diff --git a/gtk/glib-compat.c b/gtk/glib-compat.c
index c3bb8e6..9ffadbb 100644
--- a/gtk/glib-compat.c
+++ b/gtk/glib-compat.c
@@ -81,18 +81,11 @@ g_simple_async_result_take_error (GSimpleAsyncResult *simple,
  * Since: 2.28
  **/
 G_GNUC_INTERNAL void
-g_slist_free_full(GSList         *list,
-                  GDestroyNotify free_func)
+g_slist_free_full (GSList         *list,
+		   GDestroyNotify  free_func)
 {
-    GSList *el;
-
-    if (free_func) {
-        for (el = list; el ; el = g_slist_next(el)) {
-            free_func(el->data);
-        }
-    }
-
-    g_slist_free(list);
+  g_slist_foreach (list, (GFunc) free_func, NULL);
+  g_slist_free (list);
 }
 
 #endif


More information about the Spice-commits mailing list