[osg-users] Potential crash in ObjectCache::removeExpiredObjectsInCache

Robert Osfield robert.osfield at gmail.com
Fri May 4 23:33:15 PDT 2018


Hi Guy,

I tried your suggestion but it doesn't compile...

/home/robert/OpenSceneGraph/src/osgDB/ObjectCache.cpp:148:18: error:
no match for ‘operator=’ (operand types are
‘std::map<std::pair<std::__cxx11::basic_string<char>,
osg::ref_ptr<const osgDB::Options> >,
std::pair<osg::ref_ptr<osg::Object>, double>,
osgDB::ObjectCache::ClassComp>::iterator {aka
std::_Rb_tree_iterator<std::pair<const
std::pair<std::__cxx11::basic_string<char>, osg::ref_ptr<const
osgDB::Options> >, std::pair<osg::ref_ptr<osg::Object>, double> > >}’
and ‘void’)
             oitr = _objectCache.erase(oitr);
                  ^
In file included from /usr/include/c++/5/map:60:0,
                 from /home/robert/OpenSceneGraph/include/osg/GLExtensions:24,
                 from /home/robert/OpenSceneGraph/include/osg/Shader:25,
                 from /home/robert/OpenSceneGraph/include/osg/StateAttribute:20,
                 from /home/robert/OpenSceneGraph/include/osg/StateSet:18,
                 from /home/robert/OpenSceneGraph/include/osg/Node:19,
                 from /home/robert/OpenSceneGraph/include/osgDB/ObjectCache:17,
                 from /home/robert/OpenSceneGraph/src/osgDB/ObjectCache.cpp:14:
/usr/include/c++/5/bits/stl_tree.h:174:12: note: candidate:
std::_Rb_tree_iterator<std::pair<const
std::pair<std::__cxx11::basic_string<char>, osg::ref_ptr<const
osgDB::Options> >, std::pair<osg::ref_ptr<osg::Object>, double> > >&
std::_Rb_tree_iterator<std::pair<const
std::pair<std::__cxx11::basic_string<char>, osg::ref_ptr<const
osgDB::Options> >, std::pair<osg::ref_ptr<osg::Object>, double> >
>::operator=(const std::_Rb_tree_iterator<std::pair<const
std::pair<std::__cxx11::basic_string<char>, osg::ref_ptr<const
osgDB::Options> >, std::pair<osg::ref_ptr<osg::Object>, double> > >&)
     struct _Rb_tree_iterator
            ^
/usr/include/c++/5/bits/stl_tree.h:174:12: note:   no known conversion
for argument 1 from ‘void’ to ‘const
std::_Rb_tree_iterator<std::pair<const
std::pair<std::__cxx11::basic_string<char>, osg::ref_ptr<const
osgDB::Options> >, std::pair<osg::ref_ptr<osg::Object>, double> > >&’
src/osgDB/CMakeFiles/osgDB.dir/build.make:686: recipe for target
'src/osgDB/CMakeFiles/osgDB.dir/ObjectCache.cpp.o' failed
make[2]: *** [src/osgDB/CMakeFiles/osgDB.dir/ObjectCache.cpp.o] Error 1

This is with gcc 5.4.0.  What platform and compiler are you using?

Robert.


More information about the osg-users mailing list