engine/source/scriptlib/List.c
/* free everything related to the index list
   usually you dont have to do it manually, since its called by List_Clear
   but it won't hurt either */
free everything related to the index list
usually you dont have to do it manually, since its called by List_Clear
but it won't hurt either
free everything related to the index list usually you dont have to do it manually since its called by List_Clear but it won ' t hurt either
void List_FreeIndices(List *list)
{
#ifdef DEBUG
    chklist((List *)list);
#endif
    int i;
    if(!list->mindices)
    {
        return;
    }
    for (i = 0; i < 256; i++)
    {
        if(list->mindices[i])
        {
            free(list->mindices[i]->indices);
            free(list->mindices[i]->nodes);
            free(list->mindices[i]);
        }
    }
    free(list->mindices);
    list->mindices = NULL;
}
void List_FreeIndices ( List * list ) { #ifdef DEBUG chklist ( ( List * ) list ) ; #endif int i ; if ( ! list -> mindices ) { return ; } for ( i = 0 ; i < 256 ; i ++ ) { if ( list -> mindices [ i ] ) { free ( list -> mindices [ i ] -> indices ) ; free ( list -> mindices [ i ] -> nodes ) ; free ( list -> mindices [ i ] ) ; } } free ( list -> mindices ) ; list -> mindices = NULL ; }
free everything related to the index list
usually you dont have to do it manually, since its called by List_Clear
but it won't hurt either
free everything related to the index list usually you dont have to do it manually since its called by List_Clear but it won ' t hurt either