[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).
This commit is contained in:
Bill Currie 2023-12-24 02:22:46 +09:00
parent dd11a7b378
commit 767f4ff02e

View file

@ -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
}
}