From 93a76e2f56b18fc5abff5e92dc338d208441a906 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 28 Nov 2015 05:36:57 +0100 Subject: [PATCH] Revert debce0fb80, use a sleep() to work around the X11 bug Problem with debce0fb80 is the crashed process won't be killed until the user accepts the message box, and it's harder to get to the message box when the window is in full screen or the cursor is locked. --- apps/openmw/crashcatcher.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/openmw/crashcatcher.cpp b/apps/openmw/crashcatcher.cpp index 8d812efd3..0b4ff6304 100644 --- a/apps/openmw/crashcatcher.cpp +++ b/apps/openmw/crashcatcher.cpp @@ -382,7 +382,15 @@ static void crash_handler(const char *logfile) fflush(stdout); if(crash_info.pid > 0) + { gdb_info(crash_info.pid); + kill(crash_info.pid, SIGKILL); + } + + // delay between killing of the crashed process and showing the message box to + // work around occasional X server lock-up. this can only be a bug in X11 since + // even faulty applications shouldn't be able to freeze the X server. + usleep(100000); if(logfile) { @@ -390,9 +398,6 @@ static void crash_handler(const char *logfile) SDL_ShowSimpleMessageBox(0, "Fatal Error", message.c_str(), NULL); } - if (crash_info.pid > 0) - kill(crash_info.pid, SIGKILL); - exit(0); }