al_uninstall_system() vs destroy()?
AleaInfinitus

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

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.

AleaInfinitus

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

amarillion

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

Edgar Reynaldo

Some things are cleaned up automatically like bitmaps, but not everything so yeah do both.

Thread #618344. Printed from Allegro.cc