271 CxList *const cxEmptyList = &cx_empty_list; |
271 CxList *const cxEmptyList = &cx_empty_list; |
272 |
272 |
273 // </editor-fold> |
273 // </editor-fold> |
274 |
274 |
275 void cxListDestroy(CxList *list) { |
275 void cxListDestroy(CxList *list) { |
276 if (list->simple_destructor) { |
|
277 CxIterator iter = cxListIterator(list); |
|
278 cx_foreach(void*, elem, iter) { |
|
279 // already correctly resolved pointer - immediately invoke dtor |
|
280 list->simple_destructor(elem); |
|
281 } |
|
282 } |
|
283 if (list->advanced_destructor) { |
|
284 CxIterator iter = cxListIterator(list); |
|
285 cx_foreach(void*, elem, iter) { |
|
286 // already correctly resolved pointer - immediately invoke dtor |
|
287 list->advanced_destructor(list->destructor_data, elem); |
|
288 } |
|
289 } |
|
290 |
|
291 list->cl->destructor(list); |
276 list->cl->destructor(list); |
292 if (list->allocator) { |
|
293 cxFree(list->allocator, list); |
|
294 } |
|
295 } |
277 } |
296 |
278 |
297 int cxListCompare( |
279 int cxListCompare( |
298 CxList const *list, |
280 CxList const *list, |
299 CxList const *other |
281 CxList const *other |