Permalink
Browse files

fixed: Ticket #4720 - libfribidi is not threadsafe, so we wrap it in …

…a critical section.

git-svn-id: http://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/linuxport/XBMC@15251 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information...
jmarshallnz authored and elan committed Aug 29, 2008
1 parent f1c8dae commit 4c56bfcdbabb6febd86481adc071320a9208a434
Showing with 5 additions and 0 deletions.
  1. +3 −0 xbmc/utils/CharsetConverter.cpp
  2. +2 −0 xbmc/utils/CharsetConverter.h
@@ -262,6 +262,9 @@ void CCharsetConverter::logicalToVisualBiDi(const CStdStringA& strSource, CStdSt
void CCharsetConverter::logicalToVisualBiDi(const CStdStringA& strSource, CStdStringA& strDest, FriBidiCharSet fribidiCharset, FriBidiCharType base, bool* bWasFlipped/*=NULL*/)
{
+ // libfribidi is not threadsafe, so make sure we make it so
+ CSingleLock lock(m_bidiSection);
+
vector<CStdString> lines;
CUtil::Tokenize(strSource, lines, "\n");
CStdString resultString;
@@ -30,6 +30,7 @@
#include <fribidi/fribidi.h>
#include <fribidi/fribidi_char_sets.h>
#endif
+#include "CriticalSection.h"
#include <vector>
@@ -150,6 +151,7 @@ class CCharsetConverter
FriBidiCharSet m_stringFribidiCharset;
CStdString EMPTY;
+ CCriticalSection m_bidiSection;
};
extern CCharsetConverter g_charsetConverter;

0 comments on commit 4c56bfc

Please sign in to comment.