Re: [AD] exit function mechanism

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


On Tue, 2006-05-02 at 21:40 +0100, Milan Mimica wrote:
> Functions registered with _add_exit_func are called from allegro_exit, 
> which is not just called at clean program termination, but can also be 
> called when a fatal signal has been caught, on platforms that install 
> signal handlers for such signals.
> Therefore, it is possible, and it often happens to me, that some exit 
> function fails, segfaults, calls signal handler which calls this faulty 
> function from allegro_exit again and again... infinite loop.

Makes sense.

> The attached patch modifies the code so that allegro_exit unregisters 
> the function prior to calling it, preventing the above scenario to 
> happen. Explicit unregistering from a exit function is no longer needed, 
> nor it ever was so it's removed. Explicit unregistering of exit 
> functions from non-exit-function code is still allowed and used somewhere.
> 

Please explain. If I call remove_keyboard, certainly the registered exit
function must be removed?

-- 
Elias Pschernig





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