Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This fixes TD being stuck running in the background #925

Merged
merged 1 commit into from
Dec 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions tiberiandawn/startup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,16 +467,27 @@ int main(int argc, char** argv)
Memory_Error_Exit = Print_Error_Exit;

CCDebugString("C&C95 - About to exit.\n");
ReadyToQuit = 1;

#if defined(SDL_BUILD)
Reset_Video_Mode();
#endif

Sound_End();

#if defined(_WIN32)
PostMessageA(MainWindow, WM_DESTROY, 0, 0);
/*
** Flag that this is a clean shutdown (not killed with Ctrl-Alt-Del)
*/
ReadyToQuit = 1;

/*
** Post a message to our message handler to tell it to clean up.
*/
#if defined(_WIN32) && !defined(SDL_BUILD)
PostMessage(MainWindow, WM_DESTROY, 0, 0);

/*
** Wait until the message handler has dealt with the message
*/
do {
Keyboard->Check();
} while (ReadyToQuit == 1);
Expand Down Expand Up @@ -598,4 +609,4 @@ void Read_Setup_Options(RawFileClass* config_file)
*/
VideoBackBufferAllowed = ini.Get_Bool("Options", "VideoBackBuffer", true);
AllowHardwareBlitFills = ini.Get_Bool("Options", "HardwareFills", true);
}
}