From e5d2b428b86f3a09bbd035332698123971545d99 Mon Sep 17 00:00:00 2001 From: rbuj Date: Thu, 12 Sep 2019 11:21:56 +0200 Subject: Use g_list_free_full and g_slist_free_full void g_list_free_full (GList *list, GDestroyNotify free_func); void g_slist_free_full (GList *list, GDestroyNotify free_func); Convenience methods, which free all the memory used by a list, and calls free_func on every element's data. --- src/gio-utils.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/gio-utils.c') diff --git a/src/gio-utils.c b/src/gio-utils.c index 2ea4a3c..b1acd3d 100644 --- a/src/gio-utils.c +++ b/src/gio-utils.c @@ -1129,8 +1129,7 @@ directory_copy_data_free (DirectoryCopyData *dcd) g_object_unref (dcd->current_destination); dcd->current_destination = NULL; } - g_list_foreach (dcd->to_copy, (GFunc) child_data_free, NULL); - g_list_free (dcd->to_copy); + g_list_free_full (dcd->to_copy, (GDestroyNotify) child_data_free); g_free (dcd); } -- cgit v1.2.1