Re: [AD] aRts "pure virtual function call" |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
Selon Elias Pschernig <elias@xxxxxxxxxx>: > Make sure the 'make install' worked, and there is no other version of > Allegro being used. Try 'ldd extimer' - it should tell you which version > is used. I also found out that 'make uninstall' before 'make install' > sometimes fixes installation problems.. Ok, I indeed had an other allegro version installed in a different location. My bad! I think I managed to figure what leads to the crash: 1. allegro_init() creates a list of functions to be called by allegro_exit(). It also registers allegro_exit() with atexit(). 2. install_sound() adds remove_sound() to the list of function for allegro_exit(). 3. install_sound() initializes the arts driver, which initializes arts. 4. When initializing itself, arts adds its shutdown funtion to atexit. 5. ... 6. The programs ends, and atexit functions are called in reverse order of their registration, thus: 7. arts shuts itself down. 8. allegro_exit() calls remove_sound(), and the arts driver tries to free its arts stream, but arts is no more so the program crashes. I attached a patch that fixes the problem, by making the arts driver register a function with atexit() *after* having initialized arts. The tricky part was making it work wether remove_sound() was called by the user or automatically at program termination. The arts driver now also keeps track of wether it has initialized arts, which will make it easier to implement sound recording with arts. Because if I understood correctly, install_sound_input() can be called independantly from install_sound(), right ? -- Julien Cugnière
Attachment:
arts.c.diff
Description: Binary data
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |