The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Must SDL cleanup functions be used before an SDL_Quit() call
ab396356


Joined: 04 Nov 2016
Posts: 1
The SDL_Quit() function is documented to "clean up all initialized subsystems".

My question: is it mandatory to call other cleanup functions before SDL_Quit()? Such as:
actsl


Joined: 09 Feb 2016
Posts: 83
All the resources will be freed when quitting the program. But it is a matter of good practice to free the resources before quitting. Because one may want to change the code, do something else before quitting, etc. When the resources are not freed, this would be a source of many bugs. Because only when all resources are freed after using them, is the code correctly written. Then it's also easier to debug the program with the tools detecting memory leaks, such as valgrind.