- 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:
parent
ff40bcd178
commit
338ae15a4c
9 changed files with 21 additions and 124 deletions
|
|
@ -143,7 +143,6 @@ int sys_ostype = 0;
|
|||
// PRIVATE DATA DEFINITIONS ------------------------------------------------
|
||||
|
||||
static ticcmd_t emptycmd;
|
||||
static bool HasExited;
|
||||
|
||||
static WadStuff *WadList;
|
||||
static int NumWads;
|
||||
|
|
@ -342,26 +341,6 @@ void I_Init()
|
|||
I_InitSound ();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// I_Quit
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void I_Quit()
|
||||
{
|
||||
HasExited = true; /* Prevent infinitely recursive exits -- killough */
|
||||
|
||||
timeEndPeriod(TimerPeriod);
|
||||
|
||||
if (demorecording)
|
||||
{
|
||||
G_CheckDemoStatus();
|
||||
}
|
||||
|
||||
C_DeinitConsole();
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
|
|
@ -395,12 +374,7 @@ void I_FatalError(const char *error, ...)
|
|||
|
||||
throw CFatalError(errortext);
|
||||
}
|
||||
|
||||
if (!HasExited) // If it hasn't exited yet, exit now -- killough
|
||||
{
|
||||
HasExited = 1; // Prevent infinitely recursive exits -- killough
|
||||
exit(-1);
|
||||
}
|
||||
std::terminate();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue