summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ncurses.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ncurses.cc b/src/ncurses.cc
index f827471b..2f23229b 100644
--- a/src/ncurses.cc
+++ b/src/ncurses.cc
@@ -78,6 +78,9 @@ static void set_color(Color fg_color, Color bg_color)
static NCursesUI* signal_ui = nullptr;
void on_term_resize(int)
{
+ if (not signal_ui)
+ return;
+
int fd = open("/dev/tty", O_RDWR);
winsize ws;
if (fd == -1 or ioctl(fd, TIOCGWINSZ, (void*)&ws) != 0)
@@ -123,6 +126,8 @@ NCursesUI::NCursesUI()
NCursesUI::~NCursesUI()
{
endwin();
+ assert(signal_ui == this);
+ signal_ui = nullptr;
}
static void redraw(WINDOW* menu_win)