From dec32f88eb7236902efea3b9f01f31043ce96b18 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 5 Jan 2020 21:17:59 +0100 Subject: [PATCH] cc_item_text: add global mutex --- src/gui/components/cc_item_text.cpp | 3 ++- src/gui/components/cc_item_text.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index 5ebad4a9c..ab3c8c3d3 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -36,7 +36,6 @@ #include #include #include -#include using namespace std; @@ -140,6 +139,8 @@ void CComponentsText::initCBox() void CComponentsText::initCCText() { + std::lock_guard g(ct_mutex); + //set default font, if is no font definied if (ct_font == NULL) ct_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]; diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h index 97f8798f5..66ad95938 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -31,6 +31,7 @@ #include "cc_text_screen.h" #include #include +#include //! Sub class of CComponentsItem. Shows a text box. /*! @@ -76,6 +77,8 @@ class CComponentsText : public CCTextScreen, public CComponentsItem ///helper: convert int to string static std::string iToString(int int_val); //helper to convert int to string + std::mutex ct_mutex; + ///initialize all required attributes void initVarText( const int x_pos, const int y_pos, const int w, const int h, std::string text,