diff --git a/new_editor/app/Platform/Win32/EditorWindow.cpp b/new_editor/app/Platform/Win32/EditorWindow.cpp index 1c867652..2bae9230 100644 --- a/new_editor/app/Platform/Win32/EditorWindow.cpp +++ b/new_editor/app/Platform/Win32/EditorWindow.cpp @@ -233,7 +233,9 @@ bool EditorWindow::Initialize( void EditorWindow::Shutdown() { ForceReleasePointerCapture(); - m_runtime->Shutdown(); + if (m_runtime->IsReady()) { + m_runtime->Shutdown(); + } m_inputController->ClearPendingEvents(); m_chromeController->Reset(); } diff --git a/new_editor/app/Platform/Win32/WindowManager/EditorWindowMessageDispatcher.cpp b/new_editor/app/Platform/Win32/WindowManager/EditorWindowMessageDispatcher.cpp index 21f7385e..d00c33d6 100644 --- a/new_editor/app/Platform/Win32/WindowManager/EditorWindowMessageDispatcher.cpp +++ b/new_editor/app/Platform/Win32/WindowManager/EditorWindowMessageDispatcher.cpp @@ -386,6 +386,13 @@ bool EditorWindowMessageDispatcher::TryDispatchWindowLifecycleMessage( } outResult = 0; return true; + case WM_CLOSE: + if (!context.window.IsClosing()) { + context.window.MarkClosing(); + } + DestroyWindow(context.hwnd); + outResult = 0; + return true; case WM_PAINT: if (EditorWindowFrameTransferRequests transferRequests = context.window.OnPaintMessage( context.hostRuntime.GetEditorContext(),