diff --git a/stepmania/src/archutils/Win32/CrashHandlerNetworking.cpp b/stepmania/src/archutils/Win32/CrashHandlerNetworking.cpp index 9eff69a953..a0268bb968 100644 --- a/stepmania/src/archutils/Win32/CrashHandlerNetworking.cpp +++ b/stepmania/src/archutils/Win32/CrashHandlerNetworking.cpp @@ -337,14 +337,14 @@ protected: if( msg == WM_USER ) { m_iResult = WSAGETASYNCERROR( lParam ); - PostQuitMessage( 0 ); + StopRunning(); return true; } if( msg == WM_USER+1 ) { m_iResult = 0; - PostQuitMessage( 0 ); + StopRunning(); return true; } diff --git a/stepmania/src/archutils/Win32/MessageWindow.cpp b/stepmania/src/archutils/Win32/MessageWindow.cpp index 054e57a5ed..f363b31265 100644 --- a/stepmania/src/archutils/Win32/MessageWindow.cpp +++ b/stepmania/src/archutils/Win32/MessageWindow.cpp @@ -38,8 +38,9 @@ MessageWindow::~MessageWindow() void MessageWindow::Run() { - /* Process messages until we get WM_QUIT. */ - while( 1 ) + /* Process messages until StopRunning is called. */ + m_bDone = false; + while( !m_bDone ) { MSG msg; int iRet = GetMessage( &msg, m_hWnd, 0, 0 ); @@ -50,6 +51,11 @@ void MessageWindow::Run() } } +void MessageWindow::StopRunning() +{ + m_bDone = true; +} + LRESULT CALLBACK MessageWindow::WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { MessageWindow *pThis = (MessageWindow *) GetProp( hWnd, "MessageWindow" ); diff --git a/stepmania/src/archutils/Win32/MessageWindow.h b/stepmania/src/archutils/Win32/MessageWindow.h index f2c79f8627..50da20d92e 100644 --- a/stepmania/src/archutils/Win32/MessageWindow.h +++ b/stepmania/src/archutils/Win32/MessageWindow.h @@ -18,10 +18,12 @@ public: protected: virtual bool HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam ) { return false; } + void StopRunning(); private: static LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ); HWND m_hWnd; + bool m_bDone; }; #endif