Small code cleanup in ncurses_ui.cc
This commit is contained in:
parent
55e7f857a4
commit
6292d451cf
|
@ -454,17 +454,9 @@ void NCursesUI::check_resize(bool force)
|
||||||
winsize ws;
|
winsize ws;
|
||||||
if (ioctl(fd, TIOCGWINSZ, (void*)&ws) == 0)
|
if (ioctl(fd, TIOCGWINSZ, (void*)&ws) == 0)
|
||||||
{
|
{
|
||||||
auto delete_win = [](NCursesWin*& win) {
|
if (m_window) delwin(m_window);
|
||||||
if (win)
|
if (m_info) m_info.destroy();
|
||||||
{
|
if (m_menu) m_menu.destroy();
|
||||||
delwin(win);
|
|
||||||
win = nullptr;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
delete_win(m_window);
|
|
||||||
delete_win(m_info.win);
|
|
||||||
delete_win(m_menu.win);
|
|
||||||
|
|
||||||
resize_term(ws.ws_row, ws.ws_col);
|
resize_term(ws.ws_row, ws.ws_col);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user