Put "atexit(SDL_Quit)" right after "SDL_Init()"?
Created by: ollieparanoid
I've noticed that a lot of time in the code, atexit(SDL_Quit)
is called before exit()
, e.g.:
if (renderer == NULL) {
SDL_LogError(SDL_LOG_CATEGORY_VIDEO,
"ERROR: Could not create renderer: %s\n", SDL_GetError());
atexit(SDL_Quit);
exit(1);
}
I think this could be simplified by calling atexit(SDL_Quit)
once directly after SDL_Init()
and removing it before all the exit()
calls.