Replaced readImageFile() usage with readRefImageFile() to prevent threading issues with caching of imagery in the osgDB::Registry cache.

This commit is contained in:
Robert Osfield
2009-01-21 18:23:55 +00:00
parent e17535813f
commit 908432c732
21 changed files with 94 additions and 97 deletions

View File

@@ -1128,7 +1128,7 @@ osg::Image* DataInputStream::readImage(std::string filename)
// Image is not in list.
// Read it from disk,
osg::Image* image = osgDB::readImageFile(filename.c_str(),_options.get());
osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile(filename.c_str(),_options.get());
// add it to the imageList,
_imageMap[filename] = image;
@@ -1136,7 +1136,7 @@ osg::Image* DataInputStream::readImage(std::string filename)
if (_verboseOutput) std::cout<<"read/writeImage() ["<<image<<"]"<<std::endl;
return image;
return image.release();
}
osg::Image* DataInputStream::readImage()