mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Another leak
This commit is contained in:
@@ -102,6 +102,14 @@ void initInterpreter(Interpreter* interpreter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void freeInterpreter(Interpreter* interpreter) {
|
void freeInterpreter(Interpreter* interpreter) {
|
||||||
|
//BUGFIX: handle scopes/types in the exports
|
||||||
|
for (int i = 0; i < interpreter->exports->capacity; i++) {
|
||||||
|
freeLiteral(interpreter->exports->entries[i].key);
|
||||||
|
freeLiteral(interpreter->exports->entries[i].value);
|
||||||
|
freeLiteral(interpreter->exportTypes->entries[i].key);
|
||||||
|
freeLiteral(interpreter->exportTypes->entries[i].value);
|
||||||
|
}
|
||||||
|
|
||||||
//BUGFIX: handle scopes of functions, which refer to the parent scope (leaking memory)
|
//BUGFIX: handle scopes of functions, which refer to the parent scope (leaking memory)
|
||||||
while(interpreter->scope != NULL) {
|
while(interpreter->scope != NULL) {
|
||||||
for (int i = 0; i < interpreter->scope->variables.capacity; i++) {
|
for (int i = 0; i < interpreter->scope->variables.capacity; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user