Reapply "dont call I_Quit from withing quit_handler, let it signal main loop to quit"
This reverts commit 8156c6e210.
This commit is contained in:
parent
8156c6e210
commit
e711494a07
4 changed files with 17 additions and 3 deletions
|
|
@ -991,6 +991,9 @@ void D_SRB2Loop(void)
|
|||
|
||||
for (;;)
|
||||
{
|
||||
if (I_Interrupted())
|
||||
I_Quit();
|
||||
|
||||
precise_t enterprecise = I_GetPreciseTime();
|
||||
|
||||
memset(&g_dc, 0, sizeof(g_dc));
|
||||
|
|
|
|||
|
|
@ -288,6 +288,8 @@ INT32 I_StartupSystem(void);
|
|||
*/
|
||||
void I_ShutdownSystem(void);
|
||||
|
||||
boolean I_Interrupted(void);
|
||||
|
||||
/** \brief The I_GetDiskFreeSpace function
|
||||
|
||||
\param freespace a INT64 pointer to hold the free space amount
|
||||
|
|
|
|||
|
|
@ -525,11 +525,19 @@ FUNCNORETURN static ATTRNORETURN void signal_handler(INT32 num)
|
|||
}
|
||||
#endif
|
||||
|
||||
FUNCNORETURN static ATTRNORETURN void quit_handler(int num)
|
||||
static volatile sig_atomic_t interrupted = 0;
|
||||
|
||||
boolean I_Interrupted(void)
|
||||
{
|
||||
return interrupted;
|
||||
}
|
||||
|
||||
static void quit_handler(int num)
|
||||
{
|
||||
signal(num, SIG_DFL); //default signal action
|
||||
raise(num);
|
||||
I_Quit();
|
||||
//I_Quit();
|
||||
interrupted = true;
|
||||
}
|
||||
|
||||
#ifdef HAVE_TERMIOS
|
||||
|
|
|
|||
|
|
@ -1839,7 +1839,8 @@ void I_ShutdownGraphics(void)
|
|||
SDL_GL_DeleteContext(sdlglcontext);
|
||||
}
|
||||
#endif
|
||||
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
||||
if (SDL_WasInit(SDL_INIT_VIDEO) == SDL_INIT_VIDEO)
|
||||
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
||||
framebuffer = SDL_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue