Closed igorko closed 11 years ago
oops. It doesn't build.
In http://sdl.beuc.net/sdl.wiki/SDL_Quit they say we could also use atexit(SDL_Quit); Not sure what's the best approach though.
Note: While using "atexit" may be be fine for small programs, more advanced users should shut down SDL in their own cleanup code. Moreover, using "atexit" in a library is a sure way to crash dynamically loaded code.
No idea why that exit(1) is blamed by g++, but we can leave without it ;)
There's a member variable named "exit" in MenuManager. You can probably use something like "std::exit(1)" to avoid the name collision.
Another idea would be to put the exit (or abort function?) together with a previous SDL_Quit into a function, as the sequence
SDL_Quit()
exit(1);
happens to appear quite often now.
Consider this a short-term fix. During Beta we will have better clean-up code that will attempt to free memory properly.
Discovered while trying to load GameStateLoad screen on Polymorphable with Flare savegame in the list. Also added exit(1) where needed to really terminate app correctly.