mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 04:13:32 +02:00
Properly dispose the GSList chains
We forgot to free the link and the data, oops.
This commit is contained in:
parent
f4d811ddf5
commit
cfc8c9f8e2
3 changed files with 17 additions and 5 deletions
|
|
@ -218,6 +218,19 @@ GSList *gslist_remove_string (GSList *list, const char *str)
|
|||
return list;
|
||||
}
|
||||
|
||||
GSList *gslist_delete_string (GSList *list, const char *str, GDestroyNotify free_func)
|
||||
{
|
||||
GSList *l;
|
||||
|
||||
l = g_slist_find_custom(list, str, (GCompareFunc) g_strcmp0);
|
||||
if (l != NULL) {
|
||||
free_func(l->data);
|
||||
return g_slist_delete_link(list, l);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/* `list' contains pointer to structure with a char* to string. */
|
||||
char *gslistptr_to_string(GSList *list, int offset, const char *delimiter)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue