Closed roig closed 7 years ago
Can you check if your hitting issue #28? Symptoms sound similar.
Hello, i checked that issue, but no, I think it isn't related. This code is from the "compile_time" branch, the code is completely different.
The conditional is wrong I think, because it is checking every entity that has a component, but what about destroying entities that doesn't have a component? We will have to wait for alec, to check that.
thanks.
@roig you are correct that the destructor is not called, though this is somewhat intentional. EntityX maintains a free list of deleted entity slots, so to determine whether an Entity is truly valid that list needs to be walked for each ID. This could be very slow depending on the number of entities in the free list.
That said, it's still a bug.
Thank you alec!
Hello alecthomas, if you create an entity without any component and set the callbacks for on_create and on_destroy. It calls on_create callback correctly, but when my program exits, the destructor is not calling on_destroy callback.
I debugged, and found that is not entering inside the "if" (see the code), maybe because the entity has no components, i think it should call on_destroy without components attached to the entity, but I'm not sure how to fix it, any ideas ?
Thank you!