1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

crashcatcher: show the message box before killing crashed process

This change fixes a random X server lock-up that I get about 1 in 10 times when a crash is caught. I'm presuming it's an X server bug since faulty applications shouldn't be able to crash or freeze the X server under any circumstances.
This commit is contained in:
scrawl 2015-11-28 05:12:15 +01:00
parent 5b8fd79b4b
commit debce0fb80

View File

@ -382,16 +382,17 @@ static void crash_handler(const char *logfile)
fflush(stdout);
if(crash_info.pid > 0)
{
gdb_info(crash_info.pid);
kill(crash_info.pid, SIGKILL);
}
if(logfile)
{
std::string message = "OpenMW has encountered a fatal error.\nCrash log saved to '" + std::string(logfile) + "'.\n Please report this to https://bugs.openmw.org !";
SDL_ShowSimpleMessageBox(0, "Fatal Error", message.c_str(), NULL);
}
if (crash_info.pid > 0)
kill(crash_info.pid, SIGKILL);
exit(0);
}