diff --git a/lib/platform/CMSWindowsScreen.cpp b/lib/platform/CMSWindowsScreen.cpp index ee33dead..192d05bc 100644 --- a/lib/platform/CMSWindowsScreen.cpp +++ b/lib/platform/CMSWindowsScreen.cpp @@ -207,7 +207,14 @@ CMSWindowsScreen::mainLoop() // handle quit message if (event.m_msg.message == WM_QUIT) { - CThread::getCurrentThread().cancel(); + if (event.m_msg.wParam == 0) { + // force termination + CThread::getCurrentThread().cancel(); + } + else { + // just exit the main loop + break; + } } // dispatch message @@ -221,7 +228,8 @@ CMSWindowsScreen::mainLoop() void CMSWindowsScreen::exitMainLoop() { - PostThreadMessage(m_threadID, WM_QUIT, 0, 0); + // close down cleanly + PostThreadMessage(m_threadID, WM_QUIT, 1, 0); } void