alecthomas / entityx

EntityX - A fast, type-safe C++ Entity-Component system
MIT License
2.21k stars 295 forks source link

Strange sigsev on macosx when reach the end of the programm #194

Open Milerius opened 7 years ago

Milerius commented 7 years ago

Hello, i'm not sure but i have a strange bug when i reach the end of my program using entityx.

current context :

The systems are all separate in different DLL, i load them with the function systems.add(shared_ptr) :

capture d ecran 2017-07-09 a 23 22 00

the main game loop :

capture d ecran 2017-07-09 a 23 22 39

creation of entity and assignement of a Components who represents a window :

capture d ecran 2017-07-09 a 23 23 22

update of the Window System :

capture d ecran 2017-07-09 a 23 24 13

and this is what happened when i click on the cross of the SFML Window :

capture d ecran 2017-07-09 a 23 25 04

This bug dont seem's to appear on Linux, or Window, only on my macOs, (i tried on Linux this works)

Sorry for my english.

Best regards.

DomWilliams0 commented 7 years ago

Have you tried running it through valgrind with memcheck? It will tell you if you overwrite some memory at an earlier point in your code, which could be causing undefined behaviour later on.

For reference: valgrind --tool=memcheck ./<executable>

ghost commented 6 years ago

Try calling ett.reset() before you dispose of all the systems (i.e. before the entity manager goes out of scope).