From fa32d12bfa647565cce1b2f9e25ad7d7b0a1d4fc Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 21 Jun 2006 19:08:20 +0000 Subject: Let the SDL parachute catch crashes and shut down properly. Don't crash after playing demos. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 562 --- src/g_game.c | 18 ++++++++++++------ src/i_main.c | 22 ++-------------------- 2 files changed, 14 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/g_game.c b/src/g_game.c index 6fe36116..e603ee63 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: g_game.c 475 2006-05-05 19:49:34Z fraggle $ +// $Id: g_game.c 562 2006-06-21 19:08:20Z fraggle $ // // Copyright(C) 1993-1996 Id Software, Inc. // Copyright(C) 2005 Simon Howard @@ -134,7 +134,7 @@ static const char -rcsid[] = "$Id: g_game.c 475 2006-05-05 19:49:34Z fraggle $"; +rcsid[] = "$Id: g_game.c 562 2006-06-21 19:08:20Z fraggle $"; #include #include @@ -1889,15 +1889,16 @@ boolean G_CheckDemoStatus (void) realtics = endtime - starttime; fps = ((float) gametic * 35) / realtics; + // Prevent recursive calls + timingdemo = false; + demoplayback = false; + I_Error ("timed %i gametics in %i realtics (%f fps)", gametic, realtics, fps); } if (demoplayback) { - if (singledemo) - I_Quit (); - Z_ChangeTag (demobuffer, PU_CACHE); demoplayback = false; netdemo = false; @@ -1908,7 +1909,12 @@ boolean G_CheckDemoStatus (void) fastparm = false; nomonsters = false; consoleplayer = 0; - D_AdvanceDemo (); + + if (singledemo) + I_Quit (); + else + D_AdvanceDemo (); + return true; } diff --git a/src/i_main.c b/src/i_main.c index 540314ae..5fad27f3 100644 --- a/src/i_main.c +++ b/src/i_main.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: i_main.c 424 2006-03-18 21:22:09Z fraggle $ +// $Id: i_main.c 562 2006-06-21 19:08:20Z fraggle $ // // Copyright(C) 1993-1996 Id Software, Inc. // Copyright(C) 2005 Simon Howard @@ -48,7 +48,7 @@ //----------------------------------------------------------------------------- static const char -rcsid[] = "$Id: i_main.c 424 2006-03-18 21:22:09Z fraggle $"; +rcsid[] = "$Id: i_main.c 562 2006-06-21 19:08:20Z fraggle $"; #include @@ -59,11 +59,6 @@ rcsid[] = "$Id: i_main.c 424 2006-03-18 21:22:09Z fraggle $"; #include "m_argv.h" #include "d_main.h" -void SignalHandler(int signum) -{ - I_Error("Aborting due to signal %i\n", signum); -} - int main(int argc, char **argv) { @@ -72,19 +67,6 @@ int main(int argc, char **argv) myargc = argc; myargv = argv; - signal(SIGSEGV, SignalHandler); - signal(SIGTERM, SignalHandler); - signal(SIGILL, SignalHandler); - signal(SIGINT, SignalHandler); - signal(SIGFPE, SignalHandler); - signal(SIGABRT, SignalHandler); -#ifdef SIGHUP - signal(SIGHUP, SignalHandler); -#endif -#ifdef SIGPIPE - signal(SIGHUP, SignalHandler); -#endif - // start doom D_DoomMain (); -- cgit v1.2.3