asrob-uc3m / robotDevastation

A new-generation shooter with augmented reality and real robots. You can play online with other users with your PC, moving robots in championships and campaigns: all 24/7!
http://asrob-uc3m.github.io/workgroups/2017-05-28-robot-devastation.html
GNU Lesser General Public License v2.1
9 stars 4 forks source link

Close *all* resources before exit #80

Closed PeterBowman closed 7 years ago

PeterBowman commented 7 years ago

As a follow-up to #79, I'd suggest closing TTF- and IMG-related resources, too. Similarly to SDL_Init() and SDL_Quit(), the following functions apply here:

If I understand it correctly, both should be called immediately before SDL_Quit(). We should have now a proper place to call these functions from: rd::SDLScreenManager::cleanupSDL.

PeterBowman commented 7 years ago

Started with 2da58f1. Pasting atexit(3) function description for future reference (bolding mine):

The atexit() function registers the given function to be called at normal process termination, either via exit(3) or via return from the program's main(). Functions so registered are called in the reverse order of their registration; no arguments are passed.

PeterBowman commented 7 years ago

Merged. Note that it's safe to call *_Quit functions even if no modules have been initialized yet.

jgvictores commented 7 years ago

@PeterBowman Thanks! Great work!!

David-Estevez commented 7 years ago

Cool! Thanks, @PeterBowman !!