ivansafrin/Polycode — pull request #92 by mcclure (2012-02-16 08:31:14+00:00)
Title: Fix crash/hang on quit on Windows

As noted in #86, when I build a Windows version of a Polycode program, and send it to a Windows user to test, it does not quit properly-- any attempt to quit, regardless of method, produces a 10-15 second pause seemingly followed by a crash. When I added logging, I noticed that I am receiving WM_CLOSE but not WM_DESTROY.

If I make the change in this patch-- calling DefWindowProc after calling Shutdown on WM_CLOSE and thus allowing the normal WM_CLOSE handling to continue-- I get the WM_CLOSE *and* the WM_DESTROY, and the program quits politely as it should. I do not 100% understand how this patch works, but in my tests (compiling with mingw off my bitbucket fork) it seems to.