# HG changeset patch # User Mike Becker # Date 1632754819 -7200 # Node ID ca9ce2297c29801f4e3e382a55c079506f7c5a94 # Parent 0fe204d50f54fa5692c1f8cd3811a9db8648905d add node destruction in cxLinkedListDestroy() diff -r 0fe204d50f54 -r ca9ce2297c29 src/linked_list.c --- a/src/linked_list.c Sun Sep 26 18:31:24 2021 +0200 +++ b/src/linked_list.c Mon Sep 27 17:00:19 2021 +0200 @@ -177,7 +177,15 @@ } void cxLinkedListDestroy(CxList list) { - // TODO: free contents + cx_linked_list* ll = (cx_linked_list*) list; + + struct cx_linked_list_node* node = ll->begin; + while (node) { + void* next = node->next; + cxFree(list->allocator, node); + node = next; + } + cxFree(list->allocator, list); }