Revert "dont call I_Quit from within "quit_handler", let it signal main loop to quit"
This reverts commit a2feaa7fde.
This commit is contained in:
1 parent
860dc37fe4
commit
a4af254643
6 files changed
+16
-28
No files matched your search
@@ -679,9 +679,6 @@ void D_SRB2Loop(void)
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (I_Interrupted())
|
||||
I_Quit();
|
||||
|
||||
// capbudget is the minimum precise_t duration of a single loop iteration
|
||||
precise_t capbudget;
|
||||
precise_t elapsed;
|
||||
|
||||
@@ -1075,19 +1075,11 @@ FUNCNORETURN static ATTRNORETURN void signal_handler(INT32 num)
|
||||
}
|
||||
#endif
|
||||
|
||||
static volatile sig_atomic_t interrupted = 0;
|
||||
|
||||
boolean I_Interrupted(void)
|
||||
{
|
||||
return interrupted;
|
||||
}
|
||||
|
||||
static void quit_handler(int num)
|
||||
FUNCNORETURN static ATTRNORETURN void quit_handler(int num)
|
||||
{
|
||||
signal(num, SIG_DFL); //default signal action
|
||||
raise(num);
|
||||
//I_Quit();
|
||||
interrupted = true;
|
||||
I_Quit();
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBBACKTRACE
|
||||
|
||||
+1
-2
@@ -29,6 +29,7 @@ extern "C" {
|
||||
*/
|
||||
#define MAX_QUIT_FUNCS 16
|
||||
|
||||
|
||||
/** \brief Graphic system had started up
|
||||
*/
|
||||
extern UINT8 graphics_started;
|
||||
@@ -190,8 +191,6 @@ 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
|
||||
|
||||
+11
-9
@@ -1670,19 +1670,21 @@ FUNCNORETURN static ATTRNORETURN void signal_handler(INT32 num)
|
||||
}
|
||||
#endif
|
||||
|
||||
static volatile sig_atomic_t interrupted = 0;
|
||||
|
||||
boolean I_Interrupted(void)
|
||||
FUNCNORETURN static ATTRNORETURN void quit_handler(int num)
|
||||
{
|
||||
return interrupted;
|
||||
}
|
||||
#ifdef HAVE_THREADS
|
||||
if (g_main_thread_id != std::this_thread::get_id())
|
||||
{
|
||||
// Do not attempt any sort of recovery if this signal triggers off the main thread
|
||||
signal(num, SIG_DFL);
|
||||
raise(num);
|
||||
exit(-2);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void quit_handler(int num)
|
||||
{
|
||||
signal(num, SIG_DFL); //default signal action
|
||||
raise(num);
|
||||
//I_Quit();
|
||||
interrupted = true;
|
||||
I_Quit();
|
||||
}
|
||||
|
||||
static void I_RegisterSignals(void)
|
||||
|
||||
+1
-2
@@ -2012,8 +2012,7 @@ void I_ShutdownGraphics(void)
|
||||
SDL_DestroyWindow(window);
|
||||
window = NULL;
|
||||
|
||||
if (SDL_WasInit(SDL_INIT_VIDEO) == SDL_INIT_VIDEO)
|
||||
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
||||
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
||||
framebuffer = SDL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -237,8 +237,7 @@ void I_ShutdownSound(void)
|
||||
Mix_Quit();
|
||||
#endif
|
||||
|
||||
if (SDL_WasInit(SDL_INIT_AUDIO) == SDL_INIT_AUDIO)
|
||||
SDL_QuitSubSystem(SDL_INIT_AUDIO);
|
||||
SDL_QuitSubSystem(SDL_INIT_AUDIO);
|
||||
|
||||
#ifdef HAVE_LIBGME
|
||||
if (gme)
|
||||
|
||||
Reference in new issue
Block a user