SDL_Quit(3)
π SDL_Quit(3) β the SDL3 FUNCTIONS glow-up π
okay bestie, so you know how every party has to end? yeah. this is the party-ender. SDL_Quit is the function that cleans up all initialized subsystems β like, every single one. no crumbs left. β¨
π NAME π
SDL_Quit β clean up all initialized subsystems. that's it. that's the whole job. and she does it flawlessly. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_init.h>
void SDL_Quit(void);
no args, no return value, no drama. she takes nothing and gives you a clean slate. iconic behaviour honestly π«Ά
π¦ DESCRIPTION π¦
okay so listen. even if you've already shut down every initialized subsystem one by one with SDL_QuitSubSystem(), you should still call this function. yes, even then. she's not redundant, she's the final boss of cleanup. π
and the best part? it's safe to call this function even if your initialization hit errors along the way. like, if SDL_Init was messy, if stuff blew up halfway through β doesn't matter. SDL_Quit does not care. she will not crash on you. she's chill like that. π
you can hook this up with atexit() so it automatically runs when your application shuts down β super convenient, lowkey a great move for your own app, fr fr.
β οΈ but bestie, do not do that from a library or any other dynamically loaded code. that's the one thing here that is not wise. puttingatexit()-basedSDL_Quitcalls inside library code is a no. we don't do that. periodt. π
π₯ THREAD SAFETY π₯
this one only gets called on the main thread. main character energy only, no side quests, no background threads, no exceptions. if you call it from anywhere else you're on your own, and we don't want that for you. π
β AVAILABILITY β
she's been serving since SDL 3.2.0. so if your SDL is older than that... girl, upgrade. π§
π SEE ALSO π
SDL_Init(3)β the one who starts it all (her other half, the beginning to her ending π₯Ή)SDL_QuitSubSystem(3)β the piece-by-piece shutdown, for when you wanna be thorough before the grand finale
okay that's the whole page, you're so welcome. this was brought to you by Simple Directmedia Layer, SDL 3.4.18, and this exact moment in time. go forth and clean up your subsystems, bestie β SDL_Quit has your back. πππ
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms