From d7f3ee7f172097f1e0340141899d16d3f64dad4d Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 14 Mar 2025 21:13:46 +0100 Subject: [PATCH] Fixed some segfaults that could occur during emergency shutdown --- es-core/src/utils/PlatformUtil.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/es-core/src/utils/PlatformUtil.cpp b/es-core/src/utils/PlatformUtil.cpp index 5ae0dc12b..d0399445d 100644 --- a/es-core/src/utils/PlatformUtil.cpp +++ b/es-core/src/utils/PlatformUtil.cpp @@ -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();