diff options
author | louis <louis.braun@gmx.de> | 2015-04-06 09:58:33 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2015-04-06 09:58:33 +0200 |
commit | d70bfe70913602de016e14d17d4ac485a8683cf5 (patch) | |
tree | ee00aff7748877323d71ac75d97924ced3029395 /libcore | |
parent | f316b2628aa63a7d37c9a76ad147fc6e04e14fa3 (diff) | |
download | vdr-plugin-skindesigner-d70bfe70913602de016e14d17d4ac485a8683cf5.tar.gz vdr-plugin-skindesigner-d70bfe70913602de016e14d17d4ac485a8683cf5.tar.bz2 |
added locks around cTextWrappers to avoid crashed when concurrently accessing fonts
Diffstat (limited to 'libcore')
-rw-r--r-- | libcore/helpers.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libcore/helpers.c b/libcore/helpers.c index 5dc5156..9604e3a 100644 --- a/libcore/helpers.c +++ b/libcore/helpers.c @@ -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 << "..."; |