fixed why2_clean_memory memory leak
wow 'garbage collector' that cases memory leaks pls don't laugh at me :(
This commit is contained in:
parent
990476787f
commit
cd4c94024a
@ -147,12 +147,12 @@ void why2_clean_memory(char *identifier)
|
|||||||
|
|
||||||
while (buffer -> next != NULL) //GO TROUGH LIST
|
while (buffer -> next != NULL) //GO TROUGH LIST
|
||||||
{
|
{
|
||||||
if (buffer -> identifier == identifier) remove_node(buffer);
|
if (buffer -> identifier == identifier) why2_free(buffer -> pointer);
|
||||||
|
|
||||||
buffer = buffer -> next;
|
buffer = buffer -> next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buffer -> identifier == identifier) remove_node(buffer); //LAST NODE
|
if (buffer -> identifier == identifier) why2_free(buffer -> pointer); //LAST NODE
|
||||||
|
|
||||||
why2_reset_memory_identifier(); //THIS WILL CAUSE SEGFAULT IF YOU DIDN'T USE why2_set_memory_identifier
|
why2_reset_memory_identifier(); //THIS WILL CAUSE SEGFAULT IF YOU DIDN'T USE why2_set_memory_identifier
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user