Ejemplo n.º 1
0
/* sys_linux_exit:
 *  The end of the world...
 */
static void sys_linux_exit (void)
{
	/* shut down asynchronous event processing */
	__al_linux_bgman_exit();

	/* remove emergency exit signal handlers */
	signal(SIGABRT, old_sig_abrt);
	signal(SIGFPE,  old_sig_fpe);
	signal(SIGILL,  old_sig_ill);
	signal(SIGSEGV, old_sig_segv);
	signal(SIGTERM, old_sig_term);
	signal(SIGINT,  old_sig_int);
#ifdef SIGQUIT
	signal(SIGQUIT, old_sig_quit);
#endif

	/* shut down VGA helpers */
#ifdef ALLEGRO_LINUX_VGA
 	if (__al_linux_have_ioperms)
		__al_linux_shutdown_vga_helpers();
#endif

	/* unload dynamic modules */
	_unix_unload_modules();

	/* free dynamic driver lists */
	_unix_driver_lists_shutdown();

	__al_linux_shutdown_memory();
#ifdef ALLEGRO_LINUX_VGA
	iopl (0);
#endif
}
Ejemplo n.º 2
0
/* _xwin_sysdrv_exit:
 *  The end of the world...
 */
static void _xwin_sysdrv_exit(void)
{
   /* This stops the X event handler running in the background, which
    * seems a nice thing to do before closing the connection to the X
    * display... (remove this and you get SIGABRTs during XCloseDisplay).
    */
   _unix_bg_man->unregister_func(_xwin_bg_handler);

   _xwin_close_display();
   _unix_bg_man->exit();

   _unix_unload_modules();
   _unix_driver_lists_shutdown();

   signal(SIGABRT, old_sig_abrt);
   signal(SIGFPE,  old_sig_fpe);
   signal(SIGILL,  old_sig_ill);
   signal(SIGSEGV, old_sig_segv);
   signal(SIGTERM, old_sig_term);
   signal(SIGINT,  old_sig_int);

#ifdef SIGQUIT
   signal(SIGQUIT, old_sig_quit);
#endif

#ifdef ALLEGRO_MULTITHREADED
   if (_xwin.mutex) {
      _unix_destroy_mutex(_xwin.mutex);
      _xwin.mutex = NULL;
   }
#endif
}