From b85365bff85f5db3cf4a160dfad8b3590b6926a0 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 11 Jan 2020 17:22:33 +1100 Subject: [PATCH] Reset SIGHUP handler on NCursesUI destruction SIGHUP handler could trigger crashes if the EventManager was already destructed when it was triggered. Fixes #3288 --- src/ncurses_ui.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ncurses_ui.cc b/src/ncurses_ui.cc index f93bb6d0..ad096147 100644 --- a/src/ncurses_ui.cc +++ b/src/ncurses_ui.cc @@ -364,7 +364,7 @@ NCursesUI::~NCursesUI() endwin(); tcsetattr(STDIN_FILENO, TCSAFLUSH, &m_original_termios); set_signal_handler(SIGWINCH, SIG_DFL); - set_signal_handler(SIGCONT, SIG_DFL); + set_signal_handler(SIGHUP, SIG_DFL); set_signal_handler(SIGTSTP, SIG_DFL); } @@ -567,7 +567,7 @@ Optional NCursesUI::get_next_key() if (sighup_raised) { set_signal_handler(SIGWINCH, SIG_DFL); - set_signal_handler(SIGCONT, SIG_DFL); + set_signal_handler(SIGHUP, SIG_DFL); if (m_window) m_window.destroy(); m_stdin_watcher.disable();