-
Notifications
You must be signed in to change notification settings - Fork 55
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
Conversation
See my comment here: This pull request may very well fix it, practically. But it does not revert the change that broke it in the first place. I suspect when there is an SDL build it should not call "PostMessageA(MainWindow, WM_DESTROY, 0, 0);" at all, but use SDL functions to do that. On line 300 there is a similar situation with starting up. Where one either uses the SDL functions OR the windows functions. But not both:
|
This is how I fixed it for my local build:
|
I see in the RA code there is a similar idea.
Perhaps it might be a good idea to standardize? This will pretty much return it to the state before the commit that broke it. There is a separate question though if the keyboard check has any purpose and if a WIN32 build without SDL will suffer the same issue by not closing correctly. |
That guilty commit introduced Sound_End(). That was the main purpose. The original guilty commit authors can clarify maybe? As for WIN32 (non-SDL) DirectDraw build. I used such builds in the earlier stages of the project, but they seemed crash-prone in a multi-core environment. Whereas the SDL build had no such instability. Don't recall any failure to exit properly. |
In the latest commit I changed the solution to be like in VanillaRA. This keeps the PostMessage call out of SDL builds, and keeps the keyboard check for non-SDL builds. |
Your latest version of the pull request looks good to me. |
There appears to be an unintended ascii > utf8 replacement in the PR which needs reverting, you you revert that and rebase the PR onto the latest vanilla branch? |
5aff963
to
cfb91a9
Compare
This should now be fixed and the branch is rebased with the latest vanilla branch. |
Currently TD stays running after clicking on "exit game".
It gets stuck on the do/while loop that checks the keyboard for something. Not sure what the purpose of this is, but it does prevent the game from quitting.
Should probably check RA too and see if a non SDL build gets similarly stuck.