File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -467,16 +467,27 @@ int main(int argc, char** argv)
467467 Memory_Error_Exit = Print_Error_Exit;
468468
469469 CCDebugString (" C&C95 - About to exit.\n " );
470- ReadyToQuit = 1 ;
471470
472471#if defined(SDL_BUILD)
473472 Reset_Video_Mode ();
474473#endif
475474
476475 Sound_End ();
477476
478- #if defined(_WIN32)
479- PostMessageA (MainWindow, WM_DESTROY, 0 , 0 );
477+ /*
478+ ** Flag that this is a clean shutdown (not killed with Ctrl-Alt-Del)
479+ */
480+ ReadyToQuit = 1 ;
481+
482+ /*
483+ ** Post a message to our message handler to tell it to clean up.
484+ */
485+ #if defined(_WIN32) && !defined(SDL_BUILD)
486+ PostMessage (MainWindow, WM_DESTROY, 0 , 0 );
487+
488+ /*
489+ ** Wait until the message handler has dealt with the message
490+ */
480491 do {
481492 Keyboard->Check ();
482493 } while (ReadyToQuit == 1 );
@@ -598,4 +609,4 @@ void Read_Setup_Options(RawFileClass* config_file)
598609 */
599610 VideoBackBufferAllowed = ini.Get_Bool (" Options" , " VideoBackBuffer" , true );
600611 AllowHardwareBlitFills = ini.Get_Bool (" Options" , " HardwareFills" , true );
601- }
612+ }
You can’t perform that action at this time.
0 commit comments