summaryrefslogtreecommitdiff
path: root/src/gio-utils.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-09-12 11:21:56 +0200
committerraveit65 <[email protected]>2019-09-22 02:44:09 +0200
commite5d2b428b86f3a09bbd035332698123971545d99 (patch)
treee22397390228d4b0099adf8ab64bd6bee67e4999 /src/gio-utils.c
parent68ef9e00239ad3f20f78fb4822446dce62d58bab (diff)
downloadengrampa-e5d2b428b86f3a09bbd035332698123971545d99.tar.bz2
engrampa-e5d2b428b86f3a09bbd035332698123971545d99.tar.xz
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.
Diffstat (limited to 'src/gio-utils.c')
-rw-r--r--src/gio-utils.c3
1 files changed, 1 insertions, 2 deletions
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);
}