Added return into ReaderWriterOSG2::prepareReading(..) to prevent bug associated with result being discarded.

This commit is contained in:
Robert Osfield
2010-03-14 08:56:21 +00:00
parent f27c103ec7
commit bc9b28a0c9

View File

@@ -118,10 +118,18 @@ public:
Options* prepareReading( ReadResult& result, std::string& fileName, const Options* options ) const
{
std::string ext = osgDB::getLowerCaseFileExtension( fileName );
if ( !acceptsExtension(ext) ) result = ReadResult::FILE_NOT_HANDLED;
if ( !acceptsExtension(ext) )
{
result = ReadResult::FILE_NOT_HANDLED;
return 0;
}
fileName = osgDB::findDataFile( fileName, options );
if ( fileName.empty() ) result = ReadResult::FILE_NOT_FOUND;
if ( fileName.empty() )
{
result = ReadResult::FILE_NOT_FOUND;
return 0;
}
osg::ref_ptr<Options> local_opt = options ?
static_cast<Options*>(options->clone(osg::CopyOp::SHALLOW_COPY)) : new Options;
local_opt->getDatabasePathList().push_front(osgDB::getFilePath(fileName));