Commit 67c64abf authored by ledig's avatar ledig

[FIX] is with colormapping stuff... someone forgot to check if the iterator is valid

now isosurface raytracer works again without crashing
parent e12bf21e
......@@ -42,7 +42,7 @@ WGEColormapping::~WGEColormapping()
boost::shared_ptr< WGEColormapping > WGEColormapping::instance()
{
if ( !m_instance )
if ( !m_instance.get() )
{
m_instance = boost::shared_ptr< WGEColormapping >( new WGEColormapping() );
}
......@@ -95,8 +95,14 @@ void WGEColormapping::callback( osg::Node* node )
{
// get node info
NodeInfoContainerType::ReadTicket r = m_nodeInfo.getReadTicket();
NodeInfo info = r->get().find( node )->second;
r.reset();
// what if find is the last element in the map? then there wont be a second
std::map< osg::Node*, NodeInfo >::const_iterator found = r->get().find( node );
NodeInfo info;
if ( found != r->get().end() )
{
info = found->second;
// need (re-)binding?
if ( info.m_initial || m_texUpdate )
......@@ -105,5 +111,7 @@ void WGEColormapping::callback( osg::Node* node )
// implement
rt.reset();
}
}
r.reset();
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment