From 773fcae8b3cd67d850fd51146c23392c494da7c7 Mon Sep 17 00:00:00 2001 From: crs Date: Sun, 15 Dec 2002 19:58:41 +0000 Subject: [PATCH] Fixed client not reconnecting when server dies bug. --- lib/platform/CMSWindowsScreen.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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