mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Display error window on crash
This commit is contained in:
parent
4c55b5db20
commit
b82f64dea5
1 changed files with 17 additions and 12 deletions
|
@ -301,37 +301,38 @@ SDL_bool framebuffer = SDL_FALSE;
|
|||
|
||||
UINT8 keyboard_started = false;
|
||||
|
||||
#if 0
|
||||
static void signal_handler(INT32 num)
|
||||
{
|
||||
//static char msg[] = "oh no! back to reality!\r\n";
|
||||
char * sigmsg;
|
||||
char sigdef[32];
|
||||
|
||||
D_QuitNetGame(); // Fix server freezes
|
||||
|
||||
switch (num)
|
||||
{
|
||||
case SIGINT:
|
||||
sigmsg = "interrupt";
|
||||
sigmsg = "SIGINT - interrupted";
|
||||
break;
|
||||
case SIGILL:
|
||||
sigmsg = "illegal instruction - invalid function image";
|
||||
sigmsg = "SIGILL - illegal instruction - invalid function image";
|
||||
break;
|
||||
case SIGFPE:
|
||||
sigmsg = "floating point exception";
|
||||
sigmsg = "SIGFPE - floating point exception";
|
||||
break;
|
||||
case SIGSEGV:
|
||||
sigmsg = "segment violation";
|
||||
sigmsg = "SIGSEGV - segment violation";
|
||||
break;
|
||||
case SIGTERM:
|
||||
sigmsg = "Software termination signal from kill";
|
||||
sigmsg = "SIGTERM - Software termination signal from kill";
|
||||
break;
|
||||
#if !(defined (__unix_) || defined (UNIXCOMMON))
|
||||
case SIGBREAK:
|
||||
sigmsg = "Ctrl-Break sequence";
|
||||
sigmsg = "SIGBREAK - Ctrl-Break sequence";
|
||||
break;
|
||||
#endif
|
||||
case SIGABRT:
|
||||
sigmsg = "abnormal termination triggered by abort call";
|
||||
sigmsg = "SIGABRT - abnormal termination triggered by abort call";
|
||||
break;
|
||||
default:
|
||||
sprintf(sigdef,"signal number %d", num);
|
||||
|
@ -339,11 +340,15 @@ static void signal_handler(INT32 num)
|
|||
}
|
||||
|
||||
I_OutputMsg("signal_handler() error: %s\n", sigmsg);
|
||||
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
|
||||
"Signal caught",
|
||||
sigmsg, NULL);
|
||||
I_ShutdownSystem();
|
||||
signal(num, SIG_DFL); //default signal action
|
||||
raise(num);
|
||||
I_Quit();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined (NDEBUG) && !defined (DC) && !defined (_WIN32_WCE)
|
||||
FUNCNORETURN static ATTRNORETURN void quit_handler(int num)
|
||||
|
@ -739,19 +744,19 @@ void I_StartupKeyboard (void)
|
|||
{
|
||||
#if defined (NDEBUG) && !defined (DC)
|
||||
#ifdef SIGILL
|
||||
// signal(SIGILL , signal_handler);
|
||||
signal(SIGILL , signal_handler);
|
||||
#endif
|
||||
#ifdef SIGINT
|
||||
signal(SIGINT , quit_handler);
|
||||
#endif
|
||||
#ifdef SIGSEGV
|
||||
// signal(SIGSEGV , signal_handler);
|
||||
signal(SIGSEGV , signal_handler);
|
||||
#endif
|
||||
#ifdef SIGBREAK
|
||||
signal(SIGBREAK , quit_handler);
|
||||
#endif
|
||||
#ifdef SIGABRT
|
||||
// signal(SIGABRT , signal_handler);
|
||||
signal(SIGABRT , signal_handler);
|
||||
#endif
|
||||
#ifdef SIGTERM
|
||||
signal(SIGTERM , quit_handler);
|
||||
|
|
Loading…
Reference in a new issue