diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-09-12 10:54:55 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-09-12 10:54:55 +0100 |
| commit | a2b4bf09fdd2bbb914ef92158e7befdd63254dad (patch) | |
| tree | 6a3ee629cce537978737c3145ba74bdb58261e99 /src | |
| parent | ad2aa35546541d03665953b65583ed00f4164034 (diff) | |
Fix color restoring
Diffstat (limited to 'src')
| -rw-r--r-- | src/ncurses_ui.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ncurses_ui.cc b/src/ncurses_ui.cc index 8f6e195f..a29bf702 100644 --- a/src/ncurses_ui.cc +++ b/src/ncurses_ui.cc @@ -140,9 +140,6 @@ constexpr struct { unsigned char r, g, b; } builtin_colors[] = { static void restore_colors() { - if (not can_change_color()) - return; - for (size_t i = 8; i < COLORS; ++i) { auto& c = builtin_colors[i]; @@ -287,8 +284,10 @@ NCursesUI::~NCursesUI() { puts("\033[?1004l"); puts("\033[?1002l"); + const bool changed_color = can_change_color(); endwin(); - restore_colors(); + if (changed_color) + restore_colors(); signal(SIGWINCH, SIG_DFL); signal(SIGINT, SIG_DFL); } |
