Fixed some segfaults that could occur during emergency shutdown

This commit is contained in:
Leon Styhre 2025-03-14 21:13:46 +01:00
parent c8661e5186
commit d7f3ee7f17

View file

@ -387,6 +387,9 @@ namespace Utils
LOG(LogError) << "Critical - Performing emergency shutdown...";
Scripting::fireEvent("quit");
while (Window::getInstance()->getGuiStackSize() > 1 &&
Window::getInstance()->peekGui() != nullptr)
delete Window::getInstance()->peekGui();
Window::getInstance()->deinit();
Log::flush();