Changed the freetype plugin so it keeps its own ref_ptr<Font> to fonts

that it creates, rather than have osgText::Font::readFontFile() use the
osgDB::Registry object cache.

This has been done to prevent problems when users flush the object cache,
which was causing a dangling pointer.
This commit is contained in:
Robert Osfield
2003-11-20 11:07:19 +00:00
parent 84989b06b3
commit 7136a00b9a
3 changed files with 13 additions and 18 deletions

View File

@@ -65,7 +65,7 @@ osgText::Font* osgText::readFontFile(const std::string& filename)
std::string foundFile = findFontFile(filename);
if (foundFile.empty()) return 0;
osg::Object* object = osgDB::readObjectFile(foundFile,true);
osg::Object* object = osgDB::readObjectFile(foundFile);
// if the object is a font then return it.
osgText::Font* font = dynamic_cast<osgText::Font*>(object);