Program termination

When quitting and SDL app is it safe to just do a
SDL_Quit();
and then terminate the program? Or should you free up and surfaces… etc first?

You should free up surfaces. SDL doesn’t keep track of them for you.
(Although it could…)

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

When quitting and SDL app is it safe to just do a
SDL_Quit();
and then terminate the program? Or should you free up and surfaces… etc first?

-Garrett, WPI student majoring in Computer Science.

“He who joyfully marches in rank and file has already earned
my contempt. He has been given a large brain by mistake, since
for him the spinal cord would suffice.” -Albert Einstein

Shouldn’t most OS’s clean up all the memory allocated by a process when the
process terminates? With Win95/98 whether or not it cleans up memory is
dependant on the value returned by rand() but I don’t care about porting to
windows. :slight_smile:

-Garrett, WPI student majoring in Computer Science.

“He who joyfully marches in rank and file has already earned
my contempt. He has been given a large brain by mistake, since
for him the spinal cord would suffice.” -Albert EinsteinOn Wed, 28 Jul 1999, you wrote:

When quitting and SDL app is it safe to just do a
SDL_Quit();
and then terminate the program? Or should you free up and surfaces… etc first?

You should free up surfaces. SDL doesn’t keep track of them for you.
(Although it could…)

Shouldn’t most OS’s clean up all the memory allocated by a process when the
process terminates?

Yes, except for shared memory and mutexes and those sorts of things.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec