From Pjotr Svetachov, "I tried your fix and it exposed a bug in my fix :)

The problem is that the readObjectFields method will add the object to the _identifierMap. So all the other instances of that image in the same file will be replaced by the created dummy object. In my fix this was an dummy image and I didn't notice it in our scene's, probably because it covered a small part of an object. In your fix the dummy object was not an image and that leads to a crash when something tries to use it as an image. I have attached a small fix for this bug.

"


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14471 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2014-11-06 10:44:27 +00:00
parent a84df15c0a
commit 14620aa1dd

View File

@ -797,6 +797,7 @@ osg::Image* InputStream::readImage(bool readFromExternal)
// we don't want to overwrite the properties of the image in the cache as this could cause theading problems if the object is currently being used
// so we read the properties from the file into a dummy object and discard the changes.
osg::ref_ptr<osg::Object> temp_obj = readObjectFields("osg::Object", id, _dummyReadObject.get() );
_identifierMap[id] = image;
}
else
{