fix crash handler not always being installed properly
try to shut down sdl
This commit is contained in:
@@ -2,17 +2,30 @@
|
|||||||
#include "ArchHooks_Unix.h"
|
#include "ArchHooks_Unix.h"
|
||||||
#include "archutils/Unix/SignalHandler.h"
|
#include "archutils/Unix/SignalHandler.h"
|
||||||
|
|
||||||
#if defined(HAVE_BACKTRACE)
|
#if defined(CRASH_HANDLER)
|
||||||
#include "archutils/Unix/CrashHandler.h"
|
#include "archutils/Unix/CrashHandler.h"
|
||||||
#endif
|
#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()
|
ArchHooks_Unix::ArchHooks_Unix()
|
||||||
{
|
{
|
||||||
#if defined(HAVE_BACKTRACE)
|
#if defined(CRASH_HANDLER)
|
||||||
CrashHandlerHandleArgs();
|
CrashHandlerHandleArgs();
|
||||||
|
|
||||||
SignalHandler::OnClose( CrashSignalHandler );
|
SignalHandler::OnClose( CrashSignalHandler );
|
||||||
#endif
|
#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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user