예제 #1
0
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);
    }
예제 #2
0
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);
}
예제 #3
0
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);
}
예제 #4
0
파일: gui.c 프로젝트: alxm/inimaker
void gui_freeConsole(void)
{
    a_list_free(lines, true);
}