- sanitized exit code a bit

Instead of trying a homegrown way to avoid recursive exceptions, let's do it with the defined procedure C++ has for this case: call std::terminate.

This allowed removing some old hackery inherited from Boom and will now hopefully allow sanitizing the exit procedure to the point that it can be done without depending on exit handlers.
This commit is contained in:
Christoph Oelckers 2019-10-01 01:37:21 +02:00
commit 338ae15a4c
9 changed files with 21 additions and 124 deletions

View file

@ -108,6 +108,7 @@ EXTERN_CVAR(Bool, hud_althud)
EXTERN_CVAR(Int, vr_mode)
void DrawHUD();
void D_DoAnonStats();
void I_DetectOS;
// MACROS ------------------------------------------------------------------
@ -2267,6 +2268,15 @@ static void CheckCmdLine()
}
}
void I_Quit()
{
if (demorecording)
{
G_CheckDemoStatus();
}
C_DeinitConsole();
}
//==========================================================================
//
@ -2287,6 +2297,7 @@ void D_DoomMain (void)
C_InitConsole(80*8, 25*8, false);
I_DetectOS();
atterm(I_Quit);
// +logfile gets checked too late to catch the full startup log in the logfile so do some extra check for it here.
FString logfile = Args->TakeValue("+logfile");