mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 15:58:31 +00:00
added locks around cTextWrappers to avoid crashed when concurrently accessing fonts
This commit is contained in:
@@ -51,8 +51,10 @@ int Minimum(int a, int b, int c, int d, int e, int f) {
|
||||
string CutText(string &text, int width, string fontName, int fontSize) {
|
||||
if (width <= fontManager->Font(fontName, fontSize)->Size())
|
||||
return text.c_str();
|
||||
fontManager->Lock();
|
||||
cTextWrapper twText;
|
||||
twText.Set(text.c_str(), fontManager->Font(fontName, fontSize), width);
|
||||
fontManager->Unlock();
|
||||
string cuttedTextNative = twText.GetLine(0);
|
||||
stringstream sstrText;
|
||||
sstrText << cuttedTextNative << "...";
|
||||
|
Reference in New Issue
Block a user