Permalink
Browse files

Merge pull request #92 from mcclure/windowsquit

Fix crash/hang on quit on Windows
  • Loading branch information...
ivansafrin committed May 27, 2012
2 parents 35a7999 + 94f728a commit d799da84aa3224bb463c9eec17941813bdd64017
Showing with 9 additions and 2 deletions.
  1. +9 −2 Core/Contents/PolycodeView/MSVC/PolycodeView.cpp
@@ -15,6 +15,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
PAINTSTRUCT ps;
HDC hdc;
int nWidth, nHeight;
+ bool useDefault = false;
if(!core)
return DefWindowProc(hWnd, message, wParam, lParam);
@@ -88,14 +89,20 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_CLOSE:
if(core)
core->Shutdown();
+ useDefault = true;
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
- return DefWindowProc(hWnd, message, wParam, lParam);
+ useDefault = true;
+ break;
}
- return 0;
+
+ if (useDefault)
+ return DefWindowProc(hWnd, message, wParam, lParam);
+ else
+ return 0;
}

0 comments on commit d799da8

Please sign in to comment.