Convenience method, which frees all the memory used by a #GSList, and
calls the specified destroy function on every element's data.
@free_func must not modify the list (eg, by removing the freed
element from it).
It can be combined with g_steal_pointer() to ensure the list head pointer
is not left dangling — this also has the nice property that the head pointer
is cleared before any of the list elements are freed, to prevent double frees
from @free_func:
|[<!-- language="C" -->
GSList *list_of_owned_things = …; /<!-- -->* (transfer full) (element-type GObject) *<!-- -->/
g_slist_free_full (g_steal_pointer (&list_of_owned_things), g_object_unref);
]|
Convenience method, which frees all the memory used by a #GSList, and calls the specified destroy function on every element's data.
@free_func must not modify the list (eg, by removing the freed element from it).
It can be combined with g_steal_pointer() to ensure the list head pointer is not left dangling — this also has the nice property that the head pointer is cleared before any of the list elements are freed, to prevent double frees from @free_func: |[<!-- language="C" --> GSList *list_of_owned_things = …; /<!-- -->* (transfer full) (element-type GObject) *<!-- -->/ g_slist_free_full (g_steal_pointer (&list_of_owned_things), g_object_unref); ]|