From 21881490cdec4fdbec5c2f712d1a6b0f28fbef4d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 11 Nov 2003 08:52:41 +0000 Subject: [PATCH] From Dean Iversion, fix to the ReaderWriter::Options management in Pool.cpp --- src/osgPlugins/flt/Pool.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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)