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/fr-window.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/fr-window.c') diff --git a/src/fr-window.c b/src/fr-window.c index 7268b89..99dc120 100644 --- a/src/fr-window.c +++ b/src/fr-window.c @@ -220,8 +220,7 @@ fr_clipboard_data_unref (FrClipboardData *clipboard_data) g_free (clipboard_data->base_dir); g_free (clipboard_data->tmp_dir); g_free (clipboard_data->current_dir); - g_list_foreach (clipboard_data->files, (GFunc) g_free, NULL); - g_list_free (clipboard_data->files); + g_list_free_full (clipboard_data->files, g_free); g_free (clipboard_data); } -- cgit v1.2.1