SanderMertens / flecs

A fast entity component system (ECS) for C & C++

Home Page:https://www.flecs.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Destructing entity fails to remove all references when using bulk APIs

BHolman-LBI opened this issue · comments

Describe the bug
When destroying entities after populating the world using the bulk API, an ensure in ecs_delete checking that nothing is using the entity anymore fails.

    ecs_assert(!ecs_id_in_use(world, ecs_pair(EcsWildcard, entity)), 
        ECS_INTERNAL_ERROR, NULL);

I enqueue the destruction of several entities prior to world destruction, and then when flushing the defer queue the assert triggers. These are the logs that are generated prior to the assert

VeryVerbose: Queing Destruct of [0x6670] 25952.26224, type (ChildOf,25952)
VeryVerbose: Queing Destruct of [0x659C] 25952.26012, type (ChildOf,25952)
VeryVerbose: Queing Destruct of [0x6671] 25952.26012.26225, type FEntitySignal, (ChildOf,25952.26012)
VeryVerbose: Queing Destruct of [0x6664] 25952.26012.26212, type FEntitySignal, (ChildOf,25952.26012)
VeryVerbose: Queing Destruct of [0x6665] 25952.26012.26213, type FEntitySignal, (ChildOf,25952.26012)
VeryVerbose: Queing Destruct of [0x6560] 25952, type FECSSaveGame, FTransform, IsAl...

Debug_1 [31823] http: shutting down server thread
Debug_0[31642] http: no longer accepting connections on '0.0.0.0:27750'
Debug_0[31834] http: server thread shut down
Debug_1 [7196] delete tables with id (*,25952.26224)
Debug_1 [27861] system DequeueRest deactivated
Debug_3 [7066] cleanup table 29376
Debug_2 [2867] table [(ChildOf,25952.26224)] deleted with id 29375
Debug_2 [2867] table [FEntitySignal, (ChildOf,25952.26224)] deleted with id 29376
Debug_1 [35270] id (ChildOf,25952.26224) deleted
Debug_1 [35270] id (*,25952.26224) deleted

To Reproduce
Unable to reproduce in isolation. Assert stops happening when I do not use the bulk loading api

No longer able to repro due to internal code changes. Closing because I cannot verify if the bug is present still.