Closed NPittinger closed 2 years ago
Yep. Seems to reliably crash the game. I'll spend some time combing through it and seeing if I can't figure out why.
I believe I have worked out why the issue happens and have already built a fix for the issue. It needs more testing before I roll it out but I believe the fix should resolve the bug permanently and should also remove the possibility of similar, as-of-yet-undetected bugs. The technical side of things, if you're curious:
When closing a Window from another Window, it was possible to cause ImGui to fail to draw because it would attempt to draw the disposed Window.
I implemented a removal queue system that does window removal between draw cycles.
During the draw cycle of Wordsmith, the WindowSystem becomes locked. If, for any reason, a call to remove a Window happens during the draw cycle, the removal is deferred. At the end of the draw cycle, the WindowSystem is unlocked. After unlocking the system, the deferred windows are then removed.
This should effectively eliminate the possibility of Windows getting corrupted from deletion.
Steps to reproduce:
Traceback: