Fix SDL2 incomplete closedown causing crash on quit for AmigaOS 4#755
Draft
Fix SDL2 incomplete closedown causing crash on quit for AmigaOS 4#755
Conversation
Member
|
@Jarod42 I hope you don't mind, I got curious and wanted to try this github thingy ;-) |
Co-authored-by: timfel <46235+timfel@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Please work on @Wargus/stratagus/issues/744
Fix SDL2 incomplete closedown causing crash on quit for AmigaOS 4
Sep 11, 2025
Member
|
No issues to test it (and even merge it if appropriate). |
Jarod42
approved these changes
Sep 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes issue #744 where calling just
SDL_Quit()is insufficient for proper SDL cleanup on AmigaOS 4, leading to a recoverable alert about "not all resources freed" that hangs both the Stratagus application and the shell/Workbench task from which it was started.Problem
The current SDL cleanup implementation only calls
SDL_Quit()without properly destroying SDL objects first:On AmigaOS 4, the OpenGL implementation requires all SDL resources to be explicitly freed before calling
SDL_Quit(), otherwise it triggers a system alert that blocks the application.Solution
Implemented a comprehensive
CleanUpVideoSdl()function that properly destroys all SDL resources in the correct order before callingSDL_Quit():The function is now used in both normal exit (
atexit(CleanUpVideoSdl)) and debug signal handlers, ensuring complete resource cleanup in all scenarios.Changes
CleanUpVideoSdl()static function with proper resource cleanup sequenceSDL_Quit()This implementation follows the exact solution suggested in the issue and should resolve the hanging problem on AmigaOS 4 while maintaining compatibility with all other platforms.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
esm.ubuntu.com/usr/lib/apt/methods/https(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.