Closed cottonxray closed 1 year ago
Thanks for letting me know! I reproduced it, but haven't figured out what's causing it yet 🤔 It has something to do with the static strings that are allocated by the world, but for some reason aren't cleaned up when the world is a global variable.
Will check back in if I know more!
Fixed! The issue was caused by undefined construction order of global variables. What happened was:
Fortunately the string was redundant (I should've removed it a long time ago), so removing it fixed the issue :)
Describe the bug Valgrind is reporting definitely lost blocks from creating a
static flecs::world
To Reproduce
example.cpp
:CMakeLists.txt
:Now, run:
Output is:
Expected behavior I would expect Valgrind to report no leaks in this situation, although I'm certainly open to the suggestion that this is a false positive from Valgrind, or that I've done something wrong :)
Additional context Operating system:
Debian GNU/Linux 11 (bullseye)
Compiler:g++ (Debian 10.2.1-6) 10.2.1 20210110
Architecture:amd64
flecs version:a8caba8e77a016d980007854188577ffcf74370b
Extra note Just wanted to say - thanks for writing this library! It's a real joy to use. Let me know if there's anything I can do to help.