From: fennecdjay Date: Sun, 14 Aug 2022 18:56:10 +0000 (+0200) Subject: :art: improve nspc cleaning X-Git-Tag: nightly~264^2~43 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=207fc925023a66478235c4f66b3ef36efd5f5b91;p=gwion.git :art: improve nspc cleaning --- diff --git a/src/env/nspc.c b/src/env/nspc.c index ff9a00f5..a00c6272 100644 --- a/src/env/nspc.c +++ b/src/env/nspc.c @@ -48,10 +48,11 @@ ANN static void free_nspc_value(const Nspc a, Gwion gwion) { struct scope_iter iter = {a->info->value, 0, 0}; Value v; while (scope_iter(&iter, &v) > 0) { - if (isa(v->type, gwion->type[et_object]) > 0) - nspc_release_object(a, v, gwion); - else if (tflag(v->type, tflag_struct)) - nspc_release_struct(a, v, gwion); + if (tflag(v->type, tflag_cdef)) { + if (!tflag(v->type, tflag_struct)) + nspc_release_object(a, v, gwion); + else nspc_release_struct(a, v, gwion); + } value_remref(v, gwion); } free_scope(gwion->mp, a->info->value);