Closed carsonbrownlee closed 6 years ago
Thanks for the fix!
some users were reporting issues with statically allocated variables used by imgui as initialization order is not guaranteed.
It should be interesting to understand when and why this is happening... it reminds me this old post here: https://github.com/Flix01/imgui/issues/21, but I'm not sure it's related to it.
... in any case I've manually patched imguifilesystem.cpp, keeping the static method inside the ImGuiFsDrawIconStruct struct, and calling it as ImGuiFsDrawIconStruct::Get().
Hope it works now :smile:
Great thanks for the quick update! No one on our team have seen this before so it must be rare, but a user ran into it on a modern clang compiler. Apparently it's due to a statically declared variable in imguifilesystem calling a constructor which calls ImGUI calls that utilize the GImGUI variable in imgui.cpp, and GImGUI is initialized to a statically declared variable. Those functions were being called before the static variable was initialized in imgui.cpp, which then caused the crash.
OK, thanks for the detailed clarification! It can be useful to fix similar issues in the future.
I made the following fix, some users were reporting issues with statically allocated variables used by imgui as initialization order is not guaranteed. Wrapping the context in a function fixes this.