From 1ae50814d3c7fc75fe02f7ce53497cb17f8114ff Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 23 Mar 2022 17:00:22 -0700 Subject: Chapter 25.1 --- clox/src/memory.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clox/src/memory.c') 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); -- cgit v1.2.3-54-g00ecf