summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan A. Suarez Romero <jasuarez@igalia.com>2012-04-20 13:10:49 +0000
committerJuan A. Suarez Romero <jasuarez@igalia.com>2012-04-20 13:11:14 +0000
commitfa5e712283de1eed108a0856d417726c6a2400bc (patch)
treeaf553e6e13ab6da36cc504344bbcfe14d9a90467
parent863c1c6cf716147a8da03c0e231bbff27849e16f (diff)
downloadgrilo-fa5e712283de1eed108a0856d417726c6a2400bc.tar.gz
core: Use g_list_free_full() when possible
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
-rw-r--r--src/data/grl-data.c3
-rw-r--r--src/grl-media-source.c3
-rw-r--r--src/grl-multiple.c3
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;