From debce0fb8090b704bb08523cca99507960409390 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 28 Nov 2015 05:12:15 +0100 Subject: [PATCH] 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. --- apps/openmw/crashcatcher.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/openmw/crashcatcher.cpp b/apps/openmw/crashcatcher.cpp index 373d78746c..8d812efd3f 100644 --- a/apps/openmw/crashcatcher.cpp +++ b/apps/openmw/crashcatcher.cpp @@ -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); }