src/list.c

changeset 524
e98b09018d32
parent 519
79d14e821b3a
child 525
536646d1575b
     1.1 --- a/src/list.c	Mon Apr 18 14:41:19 2022 +0200
     1.2 +++ b/src/list.c	Mon Apr 18 15:29:52 2022 +0200
     1.3 @@ -50,23 +50,7 @@
     1.4              }
     1.5          }
     1.6      }
     1.7 -    if (list->autofree) {
     1.8 -        cxFree(list->allocator, list->list_destructor(list));
     1.9 -        return NULL;
    1.10 -    } else {
    1.11 -        return list->list_destructor(list);
    1.12 -    }
    1.13 +    list->cl->destructor(list);
    1.14 +    cxFree(list->allocator, list);
    1.15 +    return NULL;
    1.16  }
    1.17 -
    1.18 -void cxListMemoryMgmt(
    1.19 -        CxList *list,
    1.20 -        cx_destructor_func list_destructor,
    1.21 -        cx_destructor_func content_destructor,
    1.22 -        bool list_autofree,
    1.23 -        bool content_autofree
    1.24 -) {
    1.25 -    if (list_destructor != NULL) list->list_destructor = list_destructor;
    1.26 -    list->content_destructor = content_destructor;
    1.27 -    list->autofree = list_autofree;
    1.28 -    list->autofree_contents = content_autofree;
    1.29 -}

mercurial