diff options
Diffstat (limited to 'src/bytecode/chunk.h')
-rwxr-xr-x | src/bytecode/chunk.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bytecode/chunk.h b/src/bytecode/chunk.h index 81fc4cc..aafa0ec 100755 --- a/src/bytecode/chunk.h +++ b/src/bytecode/chunk.h | |||
@@ -32,6 +32,12 @@ chunk_init(void) { | |||
32 | void | 32 | void |
33 | chunk_free(Chunk *chunk) { | 33 | chunk_free(Chunk *chunk) { |
34 | array_free(chunk->code); | 34 | array_free(chunk->code); |
35 | for (size_t i = 0; i < array_size(chunk->constants); i++) { | ||
36 | Object obj = chunk->constants[i]; | ||
37 | if (IS_STRING(obj) || IS_SYMBOL(obj)) { | ||
38 | array_free(obj.text); | ||
39 | } | ||
40 | } | ||
35 | array_free(chunk->constants); | 41 | array_free(chunk->constants); |
36 | array_free(chunk->lines); | 42 | array_free(chunk->lines); |
37 | free(chunk); | 43 | free(chunk); |