diff --git a/src/osgPlugins/freetype/FreeTypeLibrary.cpp b/src/osgPlugins/freetype/FreeTypeLibrary.cpp index 60ba7991c..8dca50ee4 100644 --- a/src/osgPlugins/freetype/FreeTypeLibrary.cpp +++ b/src/osgPlugins/freetype/FreeTypeLibrary.cpp @@ -45,7 +45,8 @@ FreeTypeLibrary::~FreeTypeLibrary() FreeTypeFont* fontImplementation = *_fontImplementationSet.begin(); _fontImplementationSet.erase(_fontImplementationSet.begin()); osgText::Font* font = fontImplementation->_facade; - font->setImplementation(0); + if (font) font->setImplementation(0); + fontImplementation->_facade = 0; } while(!_font3DImplementationSet.empty()) @@ -53,7 +54,8 @@ FreeTypeLibrary::~FreeTypeLibrary() FreeTypeFont3D* font3DImplementation = *_font3DImplementationSet.begin(); _font3DImplementationSet.erase(_font3DImplementationSet.begin()); osgText::Font3D* font3D = font3DImplementation->_facade; - font3D->setImplementation(0); + if (font3D) font3D->setImplementation(0); + font3DImplementation->_facade = 0; } FT_Done_FreeType( _ftlibrary); @@ -76,8 +78,8 @@ bool FreeTypeLibrary::getFace(const std::string& fontfile,unsigned int index, FT } else if (error) { - osg::notify(osg::WARN)<<" .... another error code means that the font file could notd"<