From 37317def9f90df8e8b1ca91ec271c5f6eb0298fe Mon Sep 17 00:00:00 2001 From: localhorst Date: Sun, 30 Aug 2020 15:38:14 +0200 Subject: [PATCH] added mutex for ui refresh --- src/tui.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tui.cpp b/src/tui.cpp index 439b654..2536b22 100644 --- a/src/tui.cpp +++ b/src/tui.cpp @@ -7,12 +7,11 @@ #include "../include/reHDD.h" +static std::mutex mxUIrefresh; TUI::TUI(void) { - - } @@ -53,6 +52,7 @@ void TUI::initTUI() void TUI::updateTUI(vector * pvecDrives, uint8_t u8SelectedEntry) { + mxUIrefresh.lock(); int stdscrX, stdscrY; getmaxyx(stdscr, stdscrY, stdscrX); @@ -135,6 +135,8 @@ void TUI::updateTUI(vector * pvecDrives, uint8_t u8SelectedEntry) detailview=overwriteDetailViewWindow(((stdscrX)-(int)(stdscrX/3)-7), (stdscrY-15), (int)(stdscrX/3)+5); wrefresh(detailview); } + + mxUIrefresh.unlock(); } enum TUI::UserInput TUI::readUserInput()