]> Nishi Git Mirror - gwion.git/commitdiff
:bug: Free template class_def only when needed
authorJérémie Astor <astor.jeremie@wanadoo.fr>
Sun, 10 May 2020 15:53:38 +0000 (17:53 +0200)
committerJérémie Astor <astor.jeremie@wanadoo.fr>
Sun, 10 May 2020 15:53:38 +0000 (17:53 +0200)
src/lib/object_op.c

index 6a80937b96558766fe9749d3ce140ef57f10e0f2..6bc6df26f308fc82c570850cad75bc5ee3fa0923 100644 (file)
@@ -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;
 }