diff --git a/src/osgPlugins/flt/Pool.cpp b/src/osgPlugins/flt/Pool.cpp index d383b6886..0f92c4d11 100644 --- a/src/osgPlugins/flt/Pool.cpp +++ b/src/osgPlugins/flt/Pool.cpp @@ -155,9 +155,14 @@ flt::AttrData* TexturePool::getTexture(int nIndex, int fltVersion) char options[256]; sprintf(options,"FLT_VER %d",fltVersion); + // Add this line to save the existing options + osg::ref_ptr oldOptions = osgDB::Registry::instance()->getOptions(); + osgDB::Registry::instance()->setOptions(new osgDB::ReaderWriter::Options(options)); textureAttrData = dynamic_cast(osgDB::readObjectFile(attrName)); - osgDB::Registry::instance()->setOptions(NULL); // Delete options + + // Changed this line to restore the old options + osgDB::Registry::instance()->setOptions( oldOptions.get() ); // Restore options // if not found create default StateSet for the AttrData if (textureAttrData == NULL)