[grilo/0.1.x] core: Use g_list_free_full() when possible



commit fa5e712283de1eed108a0856d417726c6a2400bc
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 f09b41b..27e2459 100644
--- a/src/data/grl-data.c
+++ b/src/data/grl-data.c
@@ -158,8 +158,7 @@ grl_data_get_property (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 5e56abd..1f43720 100644
--- a/src/grl-media-source.c
+++ b/src/grl-media-source.c
@@ -805,8 +805,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 1f0b06c..f7c2982 100644
--- a/src/grl-multiple.c
+++ b/src/grl-multiple.c
@@ -292,8 +292,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]