Use free_full on GSList's instead of foreach + free

GList's used in legacy code were free'd using a g_slist_foreach + g_slist_free,
while we can just use g_slist_free_full as per GLib 2.28.

So replace code where we were using this legacy codepath.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/576
This commit is contained in:
Marco Trevisan (Treviño)
2019-05-15 13:56:35 -05:00
parent df7d8e2cbf
commit 7a17e236f7
14 changed files with 21 additions and 59 deletions

View File

@ -249,10 +249,7 @@ utf8_fputs (const char *str,
void
meta_free_gslist_and_elements (GSList *list_to_deep_free)
{
g_slist_foreach (list_to_deep_free,
(void (*)(gpointer,gpointer))&g_free, /* ew, for ugly */
NULL);
g_slist_free (list_to_deep_free);
g_slist_free_full (list_to_deep_free, g_free);
}
#ifdef WITH_VERBOSE_MODE