[spice-gtk] Use g_slist_foreach_full glib implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For the compat case (glib < 2.28), we were using our own implementation
instead of directly reusing glib code.
---
 gtk/glib-compat.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

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
-- 
1.8.3.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]