diff -r 6a981ec4d58b -r e98b09018d32 src/list.c --- a/src/list.c Mon Apr 18 14:41:19 2022 +0200 +++ b/src/list.c Mon Apr 18 15:29:52 2022 +0200 @@ -50,23 +50,7 @@ } } } - if (list->autofree) { - cxFree(list->allocator, list->list_destructor(list)); - return NULL; - } else { - return list->list_destructor(list); - } + list->cl->destructor(list); + cxFree(list->allocator, list); + return NULL; } - -void cxListMemoryMgmt( - CxList *list, - cx_destructor_func list_destructor, - cx_destructor_func content_destructor, - bool list_autofree, - bool content_autofree -) { - if (list_destructor != NULL) list->list_destructor = list_destructor; - list->content_destructor = content_destructor; - list->autofree = list_autofree; - list->autofree_contents = content_autofree; -}