From: Glenn M. <gma...@us...> - 2003-07-29 21:00:38
|
Update of /cvsroot/stepmania/stepmania/src/arch/ArchHooks In directory sc8-pr-cvs1:/tmp/cvs-serv6951 Modified Files: ArchHooks_Unix.cpp Log Message: fix crash handler not always being installed properly try to shut down sdl Index: ArchHooks_Unix.cpp =================================================================== RCS file: /cvsroot/stepmania/stepmania/src/arch/ArchHooks/ArchHooks_Unix.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ArchHooks_Unix.cpp 24 Jul 2003 08:19:20 -0000 1.1 +++ ArchHooks_Unix.cpp 29 Jul 2003 21:00:35 -0000 1.2 @@ -2,17 +2,30 @@ #include "ArchHooks_Unix.h" #include "archutils/Unix/SignalHandler.h" -#if defined(HAVE_BACKTRACE) +#if defined(CRASH_HANDLER) #include "archutils/Unix/CrashHandler.h" #endif +#include "SDL_utils.h" + +static void EmergencyShutdown( int signal ) +{ + /* If we don't actually use SDL for video, this should be a no-op. */ + if( SDL_WasInit(SDL_INIT_VIDEO) ) + SDL_QuitSubSystem(SDL_INIT_VIDEO); +} + ArchHooks_Unix::ArchHooks_Unix() { -#if defined(HAVE_BACKTRACE) +#if defined(CRASH_HANDLER) CrashHandlerHandleArgs(); SignalHandler::OnClose( CrashSignalHandler ); #endif + + /* Set up EmergencyShutdown, to try to shut down the window if we crash. + * This might blow up, so be sure to do it after the crash handler. */ + SignalHandler::OnClose( EmergencyShutdown ); } /* |