summaryrefslogtreecommitdiff
path: root/trashapplet/src
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-03-14 08:19:47 +0100
committerZenWalker <[email protected]>2019-04-14 15:24:07 +0200
commitb02b6b0fe430b9dcb137f4aaf24efde94ba70afe (patch)
tree1d0b8acaea8cf349c6368edef6b30d901d02e084 /trashapplet/src
parent538e7566185ccd4f6accd55fcb55644c0223d82f (diff)
downloadmate-applets-b02b6b0fe430b9dcb137f4aaf24efde94ba70afe.tar.bz2
mate-applets-b02b6b0fe430b9dcb137f4aaf24efde94ba70afe.tar.xz
Use g_list_free_full() convenience function
void g_list_free_full (GList *list, GDestroyNotify free_func); Convenience method, which frees all the memory used by a GList, and calls free_func on every element's data. https://developer.gnome.org/glib/stable/glib-Doubly-Linked-Lists.html#g-list-free-full
Diffstat (limited to 'trashapplet/src')
-rw-r--r--trashapplet/src/trashapplet.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/trashapplet/src/trashapplet.c b/trashapplet/src/trashapplet.c
index 4d99f576..b2fc95f0 100644
--- a/trashapplet/src/trashapplet.c
+++ b/trashapplet/src/trashapplet.c
@@ -588,10 +588,8 @@ trash_applet_drag_data_received (GtkWidget *widget,
}
}
- g_list_foreach (untrashable, (GFunc)g_object_unref, NULL);
- g_list_free (untrashable);
- g_list_foreach (trashed, (GFunc)g_object_unref, NULL);
- g_list_free (trashed);
+ g_list_free_full (untrashable, g_object_unref);
+ g_list_free_full (trashed, g_object_unref);
g_strfreev (list);