[Spice-devel] [spice-gtk] Use g_slist_foreach_full glib implementation
Marc-André Lureau
mlureau at redhat.com
Mon Aug 19 09:23:04 PDT 2013
ack
----- Mensaje original -----
> 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 at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>
More information about the Spice-devel
mailing list