In contrast with g_slist_copy(), this function uses @func to make a copy of
each list element, in addition to copying the list container itself.
@func, as a #GCopyFunc, takes two arguments, the data to be copied and a user
pointer. It's safe to pass #NULL as user_data, if the copy function takes only
one argument.
For instance, if @list holds a list of GObjects, you can do:
|[<!-- language="C" -->
another_list = g_slist_copy_deep (list, (GCopyFunc) g_object_ref, NULL);
]|
And, to entirely free the new list, you could do:
|[<!-- language="C" -->
g_slist_free_full (another_list, g_object_unref);
]|
Makes a full (deep) copy of a #GSList.
In contrast with g_slist_copy(), this function uses @func to make a copy of each list element, in addition to copying the list container itself.
@func, as a #GCopyFunc, takes two arguments, the data to be copied and a user pointer. It's safe to pass #NULL as user_data, if the copy function takes only one argument.
For instance, if @list holds a list of GObjects, you can do: |[<!-- language="C" --> another_list = g_slist_copy_deep (list, (GCopyFunc) g_object_ref, NULL); ]|
And, to entirely free the new list, you could do: |[<!-- language="C" --> g_slist_free_full (another_list, g_object_unref); ]|