We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
on_add
ecs_ensure_id
fatal: entity.c: 4689: assert: i != diff->added.count INTERNAL_ERROR 1 ecs-hook-test 0x00000001004f6dfc ecs_log_ + 512 2 ecs-hook-test 0x00000001004f6328 ecs_assert_log_ + 388 3 ecs-hook-test 0x000000010051de74 flecs_defer_end + 4816 4 ecs-hook-test 0x000000010052abb8 flecs_ensure + 844 5 ecs-hook-test 0x0000000100532e18 flecs_set_id_move + 380 6 ecs-hook-test 0x000000010051ee00 flecs_defer_end + 8796 7 ecs-hook-test 0x000000010051ba34 ecs_defer_end + 304 8 ecs-hook-test 0x0000000100435fb0 _ZN26EcsHookTest_OnAddHook_Test8TestBodyEv + 1108 9 ecs-hook-test 0x0000000100486eb4 _ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc + 292
This didn't happen on Flecs 3.2.12 (3210bff)
To Reproduce
#include "flecs.h" #include "gmock/gmock.h" #include "gtest/gtest.h" typedef struct { } EmptyComponent1; ECS_COMPONENT_DECLARE(EmptyComponent1); typedef struct { } EmptyComponent2; ECS_COMPONENT_DECLARE(EmptyComponent2); class EcsHookTest : public ::testing::Test {}; void addHook(ecs_iter_t *it) { ecs_world_t *world = it->world; for (int i = 0; i < it->count; i++) { ecs_entity_t entity = it->entities[i]; ecs_ensure_id(world, entity, ecs_id(EmptyComponent1)); ecs_ensure_id(world, entity, ecs_id(EmptyComponent2)); } } TEST_F(EcsHookTest, OnAddHook) { ecs_world_t *world = ecs_init(); ECS_COMPONENT_DEFINE(world, EmptyComponent1); ECS_COMPONENT_DEFINE(world, EmptyComponent2); ecs_entity_t eid = ecs_new(world); static const ecs_type_hooks_t hooks = { .on_add = addHook, }; ecs_set_hooks_id(world, ecs_id(EmptyComponent1), &hooks); ecs_defer_begin(world); ecs_ensure_id(world, eid, ecs_id(EmptyComponent1)); ecs_defer_end(world); }
Expected behavior
Flecs's internal state should remain consistent during this operation, and not crash
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
on_add
hook on component 1on_add
hook runsecs_ensure_id
on the entity for component 1 and component 2This didn't happen on Flecs 3.2.12 (3210bff)
To Reproduce
Expected behavior
Flecs's internal state should remain consistent during this operation, and not crash
The text was updated successfully, but these errors were encountered: