Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error handling #977

Merged
merged 2 commits into from Sep 17, 2012
Merged

Improve error handling #977

merged 2 commits into from Sep 17, 2012

Conversation

igorko
Copy link
Collaborator

@igorko igorko commented Sep 16, 2012

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.

@igorko
Copy link
Collaborator Author

igorko commented Sep 16, 2012

oops. It doesn't build.

@stefanbeller
Copy link
Collaborator

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.

@igorko
Copy link
Collaborator Author

igorko commented Sep 16, 2012

No idea why that exit(1) is blamed by g++, but we can leave without it ;)

@ghost
Copy link

ghost commented Sep 16, 2012

There's a member variable named "exit" in MenuManager. You can probably use something like "std::exit(1)" to avoid the name collision.

@stefanbeller
Copy link
Collaborator

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.

@clintbellanger
Copy link
Owner

Consider this a short-term fix. During Beta we will have better clean-up code that will attempt to free memory properly.

clintbellanger added a commit that referenced this pull request Sep 17, 2012
@clintbellanger clintbellanger merged commit 47d32d8 into clintbellanger:master Sep 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants