aboutsummaryrefslogtreecommitdiffstats
path: root/clox/src/memory.c
diff options
context:
space:
mode:
authorGravatar Tom Willemse2022-03-23 17:00:22 -0700
committerGravatar Tom Willemse2022-03-23 17:00:22 -0700
commit1ae50814d3c7fc75fe02f7ce53497cb17f8114ff (patch)
treed54dbf36a1fd0bbd9855482843e812ecc06e2009 /clox/src/memory.c
parent3da4016d5784adef217fff0ad1e3a0ceff76290f (diff)
downloadcrafting-interpreters-1ae50814d3c7fc75fe02f7ce53497cb17f8114ff.tar.gz
crafting-interpreters-1ae50814d3c7fc75fe02f7ce53497cb17f8114ff.zip
Chapter 25.1
Diffstat (limited to 'clox/src/memory.c')
-rw-r--r--clox/src/memory.c4
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);