Skip to content

Commit

Permalink
Merge pull request #92 from mcclure/windowsquit
Browse files Browse the repository at this point in the history
Fix crash/hang on quit on Windows
  • Loading branch information
ivansafrin committed May 27, 2012
2 parents 35a7999 + 94f728a commit d799da8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Core/Contents/PolycodeView/MSVC/PolycodeView.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}


Expand Down

0 comments on commit d799da8

Please sign in to comment.