Closed jpeletier closed 1 month ago
Describe the bug When destroying an entity that has a sparse component and there is an observer tracking the sparse component, I get the following assert:
fatal: sparse.c: 621: assert: dense < sparse->count INTERNAL_ERROR
Probably related to #1358 since the crash is in the same line.
To Reproduce
flecs::world ecs; struct Attribute { int value; }; auto attribute = ecs.component<Attribute>().add(flecs::Sparse); ecs.observer<Attribute>() .event(flecs::OnRemove) .each([](flecs::entity e, Attribute &attr) { std::cout << "Attibute removed" << std::endl; }); auto e = ecs.entity().add<Attribute>(); e.destruct(); // fatal: sparse.c: 621: assert: dense < sparse->count INTERNAL_ERROR
Expected behavior observer is called normally, as if the component wasn't sparse.
Fixed!
Describe the bug When destroying an entity that has a sparse component and there is an observer tracking the sparse component, I get the following assert:
Probably related to #1358 since the crash is in the same line.
To Reproduce
Expected behavior observer is called normally, as if the component wasn't sparse.