From 7e813768ed579db17f9bb01d8e141c77cb3ee61f Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 5 Sep 2024 10:09:02 +0200 Subject: [PATCH] test save replay when crashing in signal handler --- src/sdl/i_system.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index ae2f636e7..2ba900307 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -519,6 +519,9 @@ FUNCNORETURN static ATTRNORETURN void signal_handler(INT32 num) { g_in_exiting_signal_handler = true; + if (demo.recording) + G_SaveDemo(); + D_QuitNetGame(); // Fix server freezes #ifdef HAVE_LIBBACKTRACE @@ -919,6 +922,8 @@ static void I_RegisterSignals (void) #ifdef NEWSIGNALHANDLER static void signal_handler_child(INT32 num) { + if (demo.recording) + G_SaveDemo(); #ifdef HAVE_LIBBACKTRACE write_backtrace(BT_CRASH_REASON_SIGNAL(num));