/* exit_irq: * Restores the default hardware interrupt masks. */ static void exit_irq(void) { if (!pic_virgin) { outportb(0x21, default_pic1); outportb(0xA1, default_pic2); _remove_exit_func(exit_irq); pic_virgin = TRUE; } }
void serial_module_shutdown() { close_comport(); #ifndef ALLEGRO_WINDOWS // dzcomm_closedown(); #endif _remove_exit_func(serial_module_shutdown); }
/* shutdown_gfx: * Used by allegro_exit() to return the system to text mode. */ static void shutdown_gfx(void) { if (gfx_driver) set_gfx_mode(GFX_TEXT, 0, 0, 0, 0); if (system_driver->restore_console_state) system_driver->restore_console_state(); _remove_exit_func(shutdown_gfx); gfx_virgin = TRUE; }
/* remove_joystick: * Shuts down the joystick module. */ void remove_joystick() { if (_joystick_installed) { joystick_driver->exit(); joystick_driver = NULL; joy_type = JOY_TYPE_NONE; clear_joystick_vars(); _remove_exit_func(remove_joystick); _joystick_installed = FALSE; } }
/* bitmap_filetype_destructor: * Since we only want to destroy the whole list when we *actually* * quit, not just when allegro_exit() is called, we need to use a * destructor to accomplish this. */ static void bitmap_filetype_destructor(void) { BITMAP_TYPE_INFO *iter = bitmap_type_list, *next; while (iter) { next = iter->next; _AL_FREE(iter->ext); _AL_FREE(iter); iter = next; } bitmap_type_list = NULL; _remove_exit_func(register_bitmap_file_type_exit); }
/* font_filetype_destructor: * Since we only want to destroy the whole list when we *actually* * quit, not just when allegro_exit() is called, we need to use a * destructor to accomplish this. */ static void font_filetype_destructor(void) { FONT_TYPE_INFO *iter = font_type_list, *next; while (iter) { next = iter->next; _AL_FREE(iter->ext); _AL_FREE(iter); iter = next; } font_type_list = NULL; _remove_exit_func(register_font_file_type_exit); }
/* remove_mouse: * Removes the mouse handler. You don't normally need to call this, because * allegro_exit() will do it for you. */ void remove_mouse(void) { if (!mouse_driver) return; show_mouse(NULL); remove_int(mouse_move); mouse_driver->exit(); mouse_driver = NULL; _mouse_installed = FALSE; mouse_x = mouse_y = _mouse_x = _mouse_y = 0; mouse_z = _mouse_z = 0; mouse_w = _mouse_w = 0; mouse_b = _mouse_b = 0; mouse_pos = 0; mouse_polled = FALSE; destroy_bitmap(default_cursors[MOUSE_CURSOR_ARROW]); destroy_bitmap(default_cursors[MOUSE_CURSOR_BUSY]); destroy_bitmap(default_cursors[MOUSE_CURSOR_QUESTION]); destroy_bitmap(default_cursors[MOUSE_CURSOR_EDIT]); cursors[MOUSE_CURSOR_ARROW] = default_cursors[MOUSE_CURSOR_ARROW] = NULL; cursors[MOUSE_CURSOR_BUSY] = default_cursors[MOUSE_CURSOR_BUSY] = NULL; cursors[MOUSE_CURSOR_QUESTION] = default_cursors[MOUSE_CURSOR_QUESTION] = NULL; cursors[MOUSE_CURSOR_EDIT] = default_cursors[MOUSE_CURSOR_EDIT] = NULL; if (_mouse_pointer) { destroy_bitmap(_mouse_pointer); _mouse_pointer = NULL; } if (ms) { destroy_bitmap(ms); ms = NULL; destroy_bitmap(mtemp); mtemp = NULL; } _remove_exit_func(remove_mouse); }
/* register_bitmap_file_type_exit: * Free list of registered bitmap file types. */ static void register_bitmap_file_type_exit(void) { BITMAP_TYPE_INFO *iter = bitmap_type_list, *next; while (iter) { next = iter->next; _AL_FREE(iter->ext); _AL_FREE(iter); iter = next; } bitmap_type_list = NULL; /* If we are using a destructor, then we only want to prune the list * down to valid modules. So we clean up as usual, but then reinstall * the internal modules. */ #ifdef ALLEGRO_USE_CONSTRUCTOR _register_bitmap_file_type_init(); #endif _remove_exit_func(register_bitmap_file_type_exit); }