cc_item_text: add global mutex

This commit is contained in:
2020-01-05 21:17:59 +01:00
parent 46bb9cb333
commit dec32f88eb
2 changed files with 5 additions and 1 deletions

View File

@@ -36,7 +36,6 @@
#include <fstream>
#include <errno.h>
#include <system/debug.h>
#include <mutex>
using namespace std;
@@ -140,6 +139,8 @@ void CComponentsText::initCBox()
void CComponentsText::initCCText()
{
std::lock_guard<std::mutex> g(ct_mutex);
//set default font, if is no font definied
if (ct_font == NULL)
ct_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO];

View File

@@ -31,6 +31,7 @@
#include "cc_text_screen.h"
#include <gui/widget/textbox.h>
#include <string>
#include <mutex>
//! 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,