From e29423bba914e4a4d8ae0268982134c68f14b9c2 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 16 Dec 2007 13:20:38 +0000 Subject: [PATCH] Removed used of ref_ptr<>'s internally to avoid ciricular calls on destruction. --- src/osgPlugins/freetype/FreeTypeLibrary.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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"<