void a_colobject_free(AColObject* Object) { // Remove object from any lists it is in if(Object->nodes != NULL) { A_LIST_ITERATE(Object->nodes, AListNode*, n) { a_list_removeNode(n); } a_list_free(Object->nodes); }
void a_menu_free(Menu* const m) { if(m->freeItem) { while(a_list_iterate(m->items)) { m->freeItem(a_list_current(m->items)); } } a_list_free(m->items); free(m->title); free(m); }
void a_colmap_free(AColMap* Map) { for(int i = Map->h; i--; ) { for(int j = Map->w; j--; ) { // In case ColMap was freed before the ColObjects A_LIST_ITERATE(Map->submaps[i][j], AColObject*, o) { if(o->nodes != NULL) { a_list_free(o->nodes); o->nodes = NULL; } } a_list_free(Map->submaps[i][j]); } free(Map->submaps[i]); } free(Map->submaps); free(Map); }
void gui_freeConsole(void) { a_list_free(lines, true); }