Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » al_uninstall_system() vs destroy()?

This thread is locked; no one can reply to it. rss feed Print
al_uninstall_system() vs destroy()?
AleaInfinitus
Member #18,873
December 2020

Right now I'm just calling destroy functions for my font, display, timer, bitmaps, etc. at the end of program execution. Is this all necessary or could I replace it all with just al_uninstall_system()? I've seen people talking about it, but no clear on answer on what it actually handles.

amarillion
Member #940
January 2001
avatar

In general, it's a good habit to clean up your resources one by one before you call al_uninstall_system().

If you don't, you might get away with it most of the time, but I've seen bugs crop up because certain objects weren't destroyed. For example, if you do not destroy audio stream objects, a thread will keep running and your game won't shut down properly.

--
Martijn van Iersel | My Blog | Sin & Cos | Food Chain Farm | Support TINS

AleaInfinitus
Member #18,873
December 2020

So I should be calling uninstall system alongside my destroy functions?

amarillion
Member #940
January 2001
avatar

Yes, it is my understanding that you have to call both.

--
Martijn van Iersel | My Blog | Sin & Cos | Food Chain Farm | Support TINS

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Go to: