Skip to content
This repository was archived by the owner on Jan 14, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/glib.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ GSList *g_slist_prepend (GSList *list,
gpointer data);
void g_slist_free (GSList *list);
void g_slist_free_1 (GSList *list);
void g_slist_free_full (GSList *list,
GDestroyNotify free_func);
GSList *g_slist_copy (GSList *list);
GSList *g_slist_concat (GSList *list1,
GSList *list2);
Expand Down
11 changes: 11 additions & 0 deletions src/gslist.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,17 @@ g_slist_free (GSList *list)
}
}

void
g_slist_free_full (GSList *list, GDestroyNotify free_func)
{
while (list) {
GSList *next = list->next;
(*free_func) (list->data);
g_slist_free_1 (list);
list = next;
}
}

GSList*
g_slist_copy (GSList *list)
{
Expand Down