From d5f281a7688f107df2a2717e6d8eed7aab55dc25 Mon Sep 17 00:00:00 2001 From: SirLynix Date: Sat, 28 Jan 2023 18:16:50 +0100 Subject: [PATCH] Core/AppWindowingComponent: Don't quit app if no window has been created yet --- src/Nazara/Platform/AppWindowingComponent.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Nazara/Platform/AppWindowingComponent.cpp b/src/Nazara/Platform/AppWindowingComponent.cpp index 7e59b4614..80b898160 100644 --- a/src/Nazara/Platform/AppWindowingComponent.cpp +++ b/src/Nazara/Platform/AppWindowingComponent.cpp @@ -16,12 +16,13 @@ namespace Nz { Window& window = **it; if (!window.IsOpen(true)) + { it = m_windows.erase(it); + if (m_quitOnLastWindowClosed && m_windows.empty()) + GetApp().Quit(); + } else ++it; } - - if (m_quitOnLastWindowClosed && m_windows.empty()) - GetApp().Quit(); } }