From 8ae02bea8a30cffc41dc90be9ed3261032e59cf5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Sun, 10 May 2020 17:53:38 +0200 Subject: [PATCH] :bug: Free template class_def only when needed --- src/lib/object_op.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/object_op.c b/src/lib/object_op.c index 6a80937b..6bc6df26 100644 --- a/src/lib/object_op.c +++ b/src/lib/object_op.c @@ -414,7 +414,8 @@ ANN static Type scan_class(const Env env, const Type t, const Type_Decl* td) { envset_pop(&es, t->e->owner_class); if(ret > 0) return a->base.type; - free_class_def(env->gwion->mp, a); + if(!a->base.type) + free_class_def(env->gwion->mp, a); return NULL; } -- 2.43.0