mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
#15 Fixed some of the worst memory leaks
This commit is contained in:
@@ -301,7 +301,7 @@ void printLiteralCustom(Literal literal, void (printFn)(const char*)) {
|
||||
|
||||
void freeLiteral(Literal literal) {
|
||||
if (IS_STRING(literal)) {
|
||||
FREE_ARRAY(char, AS_STRING(literal), STRLEN(literal));
|
||||
FREE_ARRAY(char, AS_STRING(literal), STRLEN(literal) + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ void freeLiteral(Literal literal) {
|
||||
// }
|
||||
|
||||
if (IS_IDENTIFIER(literal)) {
|
||||
FREE_ARRAY(char, AS_IDENTIFIER(literal), STRLEN_I(literal));
|
||||
FREE_ARRAY(char, AS_IDENTIFIER(literal), STRLEN_I(literal) + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user