[grilo] core: Use g_list_free_full() when possible



commit ddde75b64427d95e585cf5e98d1b1006114f6f78
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Fri Apr 20 13:10:49 2012 +0000

    core: Use g_list_free_full() when possible
    
    Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>

 src/data/grl-data.c    |    3 +--
 src/grl-media-source.c |    3 +--
 src/grl-multiple.c     |    3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/src/data/grl-data.c b/src/data/grl-data.c
index fbfad3d..f8e4927 100644
--- a/src/data/grl-data.c
+++ b/src/data/grl-data.c
@@ -99,8 +99,7 @@ grl_data_finalize (GObject *object)
 static void
 free_list_values (GrlKeyID key, GList *values, gpointer user_data)
 {
-  g_list_foreach (values, (GFunc) g_object_unref, NULL);
-  g_list_free (values);
+  g_list_free_full (values, g_object_unref);
 }
 
 /* Returns the sample key that represents the set of keys related with @key */
diff --git a/src/grl-media-source.c b/src/grl-media-source.c
index 6f4dc14..3778534 100644
--- a/src/grl-media-source.c
+++ b/src/grl-media-source.c
@@ -811,8 +811,7 @@ multiple_result_async_cb (GrlMediaSource *source,
     ds->error = g_error_copy (error);
 
     /* Free previous results */
-    g_list_foreach (ds->data, (GFunc) g_object_unref, NULL);
-    g_list_free (ds->data);
+    g_list_free_full (ds->data, g_object_unref);
 
     ds->data = NULL;
     ds->complete = TRUE;
diff --git a/src/grl-multiple.c b/src/grl-multiple.c
index 629d8a3..cbe27fe 100644
--- a/src/grl-multiple.c
+++ b/src/grl-multiple.c
@@ -310,8 +310,7 @@ multiple_result_async_cb (GrlMediaSource *source,
     ds->error = g_error_copy (error);
 
     /* Free previous results */
-    g_list_foreach (ds->data, (GFunc) g_object_unref, NULL);
-    g_list_free (ds->data);
+    g_list_free_full (ds->data, g_object_unref);
 
     ds->data = NULL;
     ds->complete = TRUE;



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