diff options
Diffstat (limited to 'src/idlist.c')
-rw-r--r-- | src/idlist.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/idlist.c b/src/idlist.c index 5b4d99b..b9d551a 100644 --- a/src/idlist.c +++ b/src/idlist.c @@ -53,3 +53,14 @@ void list_foreach(struct idlist *list, void (*job)(void *)) job(list->obj); } } + +void list_destroy(struct idlist *list) +{ + if (list) { + while (list->next) { + list = list->next; + free(list->prev); + } + free(list); + } +} |