try fix the deinit, but no luck
This commit is contained in:
parent
1fee11fdba
commit
8a8348fc59
@ -14,19 +14,24 @@ CMDList_t* CMDList_init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// free up the full tree from memory
|
// free up the full tree from memory
|
||||||
|
// does not free up the commands
|
||||||
int CMDList_deinit(CMDList_t *list)
|
int CMDList_deinit(CMDList_t *list)
|
||||||
{
|
{
|
||||||
CMDList_t* chars[26]; //TODO: cast list to array
|
CMDList_t** list_p = (CMDList_t**)list;
|
||||||
|
// printf("deinit %p\n", (void*)list);
|
||||||
|
// printf("deinit e %p\n", list->e);
|
||||||
|
|
||||||
for (int i = 0; i < 26; i++)
|
for (int i = 0; i < 26; i++)
|
||||||
{
|
{
|
||||||
if (chars[i] != NULL)
|
if (*(list_p + i) != NULL)
|
||||||
{
|
{
|
||||||
CMDList_deinit(chars[i]);
|
// printf("deinit %i\n", i);
|
||||||
|
CMDList_deinit(*(list_p + i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free(list);
|
//TODO: fix "free(): invalid pointer"
|
||||||
|
// free(list);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user