I have a basic app which has a login dialog that displays when the app starts up. the user has to the option to login, or quit. when they click quit, I call,

PostQuitMessage(0);

This works okay in debug, but crashes the app in release. Any ideas what could be wrong?