allegro_exit man page
allegro_exit — Closes down the Allegro system.
Closes down the Allegro system. This includes returning the system to text mode and removing whatever mouse, keyboard, and timer routines have been installed. You don't normally need to bother making an explicit call to this function, because allegro_init() installs it as an atexit() routine so it will be called automatically when your program exits.
Note that after you call this function, other functions like destroy_bitmap() will most likely crash. This is a problem for C++ global destructors, which usually get called after atexit(), so don't put Allegro calls in them. You can write the destructor code in another method which you can manually call before your program exits, avoiding this problem.
install_allegro(3), allegro_init(3), destroy_bitmap(3), ex3d(3), exscn3d(3), exswitch(3), exxfade(3), exzbuf(3)
allegro_init(3), ex3d(3), exscn3d(3), exswitch(3), exxfade(3), exzbuf(3), install_allegro(3), remove_joystick(3), remove_keyboard(3), remove_mouse(3), remove_sound(3), remove_sound_input(3), remove_timer(3).