From 767f4ff02ec8ee5d7ce142c9da5b541100815f23 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 24 Dec 2023 02:22:46 +0900 Subject: [PATCH] [ui] Plug a hierarchy reference leak I'm not entirely sure what's going on yet, but deleting the referenced view via its entity rather than the view results in a corrupted href in the component pool (with a null entity id in the dense array) and then an href component leak (as well as some very weird numbers when dumping canvas bounds). I suspect Hierref_DestroyComponent is missing a few steps (though I do need to verify that it's getting called in this particular case). --- libs/ui/imui.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/ui/imui.c b/libs/ui/imui.c index d2abb073b..553abc1ef 100644 --- a/libs/ui/imui.c +++ b/libs/ui/imui.c @@ -133,7 +133,16 @@ imui_reference_destroy (void *_ref) { imui_reference_t *ref = _ref; if (ref->ctx) { +#if 1 + //FIXME there's something wrong such that deleting the entity directly + //instead of via a view results in corrupted href componets and an + //href component leak + auto ctx = ref->ctx; + auto view = View_FromEntity (ctx->vsys, ref->ref_id); + View_Delete (view); +#else ECS_DelEntity (ref->ctx->csys.reg, ref->ref_id); +#endif } }