From: Jérémie Astor Date: Sun, 10 May 2020 15:53:38 +0000 (+0200) Subject: :bug: Free template class_def only when needed X-Git-Tag: nightly~1592 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=8ae02bea8a30cffc41dc90be9ed3261032e59cf5;p=gwion.git :bug: Free template class_def only when needed --- 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; }