src/list.c

changeset 526
b070ef465313
parent 525
536646d1575b
child 528
4fbfac557df8
equal deleted inserted replaced
525:536646d1575b 526:b070ef465313
30 30
31 CxList *cxListDestroy(CxList *list) { 31 CxList *cxListDestroy(CxList *list) {
32 if (list->content_destructor != NULL) { 32 if (list->content_destructor != NULL) {
33 CxIterator iter = cxListBegin(list); 33 CxIterator iter = cxListBegin(list);
34 cx_foreach(void*, elem, iter) { 34 cx_foreach(void*, elem, iter) {
35 cxFree(list->allocator, list->content_destructor(elem)); 35 list->content_destructor(elem);
36 } 36 }
37 } 37 }
38 list->cl->destructor(list); 38 list->cl->destructor(list);
39 cxFree(list->allocator, list); 39 cxFree(list->allocator, list);
40 return NULL; 40 return NULL;

mercurial