SDL_Quit() causes a segmentation fault.
If SDL_Init() was called outside of the main function, then SDL_Quit won't work properly.
Can you provide a simple example so we can see what’s happening?
Ok so let's say I have an initialisation function that I call at the beginning of the program with the call to SDL_Init in it. When said program ends, calling SDL_Quit, be it at the end of the main, with an atexit or with a custom exit function will cause a segmentation fault. The temporary fix was to call both SDL_Init() and SDL_Quit() in the main function.
@CorruptVoidSoul I'm using SDL_Init & SDL_Quit outside main successfully on Android & Windows using SDL3. Can you reproduce the crash using a minimal example? Which platform and which version of SDL are you using?
Running SDL 2.30.0 on Termux (Android) and compiling with Clang or MinGW depending on the target. I didn't feel like updating to SDL3 because going from 1.14 to 2 was a titanic task for a beginner like me, so if I have to redo the same for SDL3 i'm not gonna feel good. Maybe SDL3 has this issue fixed. Also it isn't available on the Termux repos. I guess I could only use it for cross-compiling.
SDL3 is still evolving and would be another titanic task to migrate to, as you said. SDL2 should work, it was working when I last used it. Might be something that happened during your SDL1 to SDL2 migration? Can you test your build on a desktop? Can you create a minimal Android build to reproduce it?
I did the migration for another project, the one I discovered the bug on was made with SDL2 since the beginning. However Windows does not warn me about the seg fault.