-
-
Notifications
You must be signed in to change notification settings - Fork 543
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
An internal error is triggered after a component is removed from an entity that a cached query previously found via up
traversal.
To Reproduce
int main() {
struct Tag {};
flecs::world world;
world.component<Tag>();
world.system().with<Tag>().up().each([](flecs::entity e) {
std::cout << e << '\n';
});
world.system().run([&](flecs::iter &) {
world.remove_all<Tag>();
});
flecs::entity parent = world.entity();
parent.child();
world.progress(); // nothing happens
parent.add<Tag>();
world.progress(); // system matches child entity
world.progress(); // crashes
}
The error is this one:
fatal: cache_iter.c: 42: assert: tr != NULL INTERNAL_ERROR
Disabling caching on the system with .cache_kind(flecs::QueryCacheNone)
is a workaround.
Expected behavior
This should not crash.
Additional context
Flecs version 4.1.0.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working