RE: [AD] destroy_bitmap after allegro_exit

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Title: RE: [AD] destroy_bitmap after allegro_exit

>       /* normal memory or sub-bitmap destruction */
>       if (system_driver->destroy_bitmap) {
>          if (system_driver->destroy_bitmap(bitmap))
>             return;
>       }

It makes sense to me to not call Allegro routines after Allegro
was exited. It is not hard to do that. Static objects are evil
anyway :) If anything, refcount them, and let them autodestruct
when nothing references them anymore (which should be before the
end of main, in most cases).
What could be done, however, is to not automatically setup Allegro
to call allegro_exit in an atexit routine, and leave that to the
programmer. This would leave some freedom as to where/when to call
it with regard to the program flow (for instance, programs using
GCC specifics can assign priorities to constructor routines, and
thus ensuring shutdown in the right order).
Of course, this last one ain't no portable :/

--
Vincent Penquerc'h



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/