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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user