Re: [AD] [LINUX] VGA/ModeX drivers |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> The solution is to copy Allegro :-) allegro_exit() doesn't unregister
> itself, but it doesn't have any side effects if called twice (because it
> keeps a count of nested install/remove calls).
Yes, but Allegro is nonetheless as dumb as SVGAlib on this topic: suppose
that another lib wants to make its interface with Allegro a module. Then
allegro_exit() is automatically registered by allegro_init() and there is
still no way to unregister it. So if the module is unmapped too early, the
libc will try to reach the former address of allegro_exit() and issue a big
SIGSEGV at this point.
As Javier said, automatically registering via atexit() is not very nice for
a library. So if we ask the SVGAlib people to change the lib for us (I
didn't find anything in the 1.4.3 sources), I think we will have the moral
obligation to do the same for Allegro, i.e to provide an
install_allegro_clean() or something like that, which doesn't try to mess up
the libc with atexit().
--
Eric Botcazou
ebotcazou@xxxxxxxxxx