Question about SDL_Quit and SDL_FreeSurface

Hello,

The SDL docs don’t seem too clear about what resources are freed
when SDL_Quit is called (for the video subsystem).

Should I free all surfaces (including the display surface perhaps?)
before I call SDL_Quit. Is it OK to free them after calling SDL_Quit?

AFAICS from a quick look at the code, the display surface is freed
(by the SDL_VideoQuit), but no other surfaces are. It also appears
that SDL_FreeSurface shouldn’t be too upset if it’s called after
SDL_Quit (but I’m not too sure about that).

TIA for any enlightenment–
Adrian Hey

The SDL docs don’t seem too clear about what resources are freed
when SDL_Quit is called (for the video subsystem).

Should I free all surfaces (including the display surface perhaps?)
before I call SDL_Quit.

You should free all surfaces except the display surface before calling
SDL_Quit(). It actually should be safe to free that one too, since SDL
checks internally and doesn’t do anything if you try.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment