diff options
Diffstat (limited to 'clox/src/memory.c')
-rw-r--r-- | clox/src/memory.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clox/src/memory.c b/clox/src/memory.c index e88b91f..3124bb6 100644 --- a/clox/src/memory.c +++ b/clox/src/memory.c @@ -17,6 +17,10 @@ void *reallocate(void *pointer, size_t oldSize, size_t newSize) { static void freeObject(Obj *object) { switch (object->type) { + case OBJ_CLOSURE: { + FREE(ObjClosure, object); + break; + } case OBJ_FUNCTION: { ObjFunction *function = (ObjFunction *)object; freeChunk(&function->chunk); |