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