mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-30 19:22:14 +00:00
Avoid signal-unsafe operations in POSIX signal handler (#16160)
This commit is contained in:
parent
56a7f0b7cf
commit
0bb87eb1ff
11 changed files with 53 additions and 42 deletions
|
@ -33,6 +33,8 @@
|
|||
#include "client/sound/sound_openal.h"
|
||||
#endif
|
||||
|
||||
#include <csignal>
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
void TextDestGuiEngine::gotText(const StringMap &fields)
|
||||
|
@ -104,7 +106,7 @@ GUIEngine::GUIEngine(JoystickController *joystick,
|
|||
RenderingEngine *rendering_engine,
|
||||
IMenuManager *menumgr,
|
||||
MainMenuData *data,
|
||||
bool &kill) :
|
||||
volatile std::sig_atomic_t &kill) :
|
||||
m_rendering_engine(rendering_engine),
|
||||
m_parent(parent),
|
||||
m_menumanager(menumgr),
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
#include "util/enriched_string.h"
|
||||
#include "translation.h"
|
||||
|
||||
#include <csignal>
|
||||
|
||||
/******************************************************************************/
|
||||
/* Structs and macros */
|
||||
/******************************************************************************/
|
||||
|
@ -124,7 +126,7 @@ public:
|
|||
RenderingEngine *rendering_engine,
|
||||
IMenuManager *menumgr,
|
||||
MainMenuData *data,
|
||||
bool &kill);
|
||||
volatile std::sig_atomic_t &kill);
|
||||
|
||||
/** default destructor */
|
||||
virtual ~GUIEngine();
|
||||
|
@ -193,7 +195,7 @@ private:
|
|||
irr_ptr<GUIFormSpecMenu> m_menu;
|
||||
|
||||
/** reference to kill variable managed by SIGINT handler */
|
||||
bool &m_kill;
|
||||
volatile std::sig_atomic_t &m_kill;
|
||||
|
||||
/** variable used to abort menu and return back to main game handling */
|
||||
bool m_startgame = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue