An MFC app crashes on startup at the same place about 30% of the time. I have seen the debug version crash a couple times, but not nearly as often as the release version.
It appears to be internal to MFC LoadState()
processing. If you delete the workspace
before each start then it never crashes.
I've created a sample project to reproduce the problem. It's located at the following link: LoadStateBug Example
I'm using VS2017. Extract the zip, load the project, use x64 / release build. To make it crash, I press F5, click the X to close the window and repeat over and over, within 10 times you should see the crash (sometimes it takes a few more).
Is there something in the sample causing it or is it MFC? If MFC, is there a fix or workaround.
Thanks.