Re: [AD] aRts "pure virtual function call" |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> Selon Eric Botcazou <ebotcazou@xxxxxxxxxx>:
>> > I think this came up before, but couldn't find a reference to it.
>>
>> Yes, we had this kind of problem with the SVGAlib module, but we
>> "fixed" it by not unloading the module on exit. In light of your
>> diagnostic, I can't figure out the rationale anymore...
>
The rationale was that SVGAlib registers its own shutdown function with
atexit(), and so if the SVGAlib module was unloaded, the atexit mechanism
would be left with a dangling function reference.
> The rationale for not unloading the module on exit ? I don't know. It
> sure is *much* easier. In the case of the arts driver, I considered
> doing this, but what if the user calls remove_sound() in the middle of
> the program ? The sound wouldn't really be removed... this could be
> reasonable, though.
The sound system could be shut down whilst leaving the module loaded in
memory.
>
> I have found a problem with the patch I proposed: each time
> install_sound is called, a new function is registered with atexit. This
> doesn't break anything, and my solution still works, but this could be
> considered a memory leak... I'll think some more about it tonight.
If it's the same problem as the SVGAlib module, then your patch won't work.
>
> Argh! This atexit stuff is a real mess :-)
Worst. Design. Ever.