From 2e0472ba7e05e680a9a7e0bc7676d4e5a12eefa5 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 31 Jan 2020 10:37:25 +0000 Subject: [PATCH] Added mutex lock to avoid threading issues when glyphs are added to a Font from multiple threads --- src/osgText/Font.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/osgText/Font.cpp b/src/osgText/Font.cpp index 1a3e17607..b9d413f20 100644 --- a/src/osgText/Font.cpp +++ b/src/osgText/Font.cpp @@ -492,6 +492,8 @@ void Font::addGlyph(const FontResolution& fontRes, unsigned int charcode, Glyph* void Font::assignGlyphToGlyphTexture(Glyph* glyph, ShaderTechnique shaderTechnique) { + OpenThreads::ScopedLock lock(_glyphMapMutex); + int posX=0,posY=0; GlyphTexture* glyphTexture = 0;