Changed Font's mutex to become a static mutex shared between all instances of Font.
This ensures single threaded access of the freetype plugin.
This commit is contained in:
@@ -30,6 +30,12 @@ static osg::ApplicationUsageProxy Font_e0(osg::ApplicationUsage::ENVIRONMENTAL_V
|
||||
|
||||
static OpenThreads::Mutex s_FontFileMutex;
|
||||
|
||||
Font::FontMutex* osgText::Font::getSerializeFontCallsMutex()
|
||||
{
|
||||
static OpenThreads::Mutex s_FontCallsMutex;
|
||||
return &s_FontCallsMutex;
|
||||
}
|
||||
|
||||
std::string osgText::findFontFile(const std::string& str)
|
||||
{
|
||||
// try looking in OSGFILEPATH etc first for fonts.
|
||||
|
||||
@@ -464,7 +464,7 @@ void Text::computeGlyphRepresentation()
|
||||
return;
|
||||
}
|
||||
|
||||
OpenThreads::ScopedLock<Font::FontMutex> lock(*(activefont->getSerializeFontCallsMutex()));
|
||||
OpenThreads::ScopedLock<Font::FontMutex> lock(*(Font::getSerializeFontCallsMutex()));
|
||||
|
||||
// initialize bounding box, it will be expanded during glyph position calculation
|
||||
_textBB.init();
|
||||
|
||||
Reference in New Issue
Block a user