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() ...@@ -42,7 +42,7 @@ WGEColormapping::~WGEColormapping()
boost::shared_ptr< WGEColormapping > WGEColormapping::instance() boost::shared_ptr< WGEColormapping > WGEColormapping::instance()
{ {
if ( !m_instance ) if ( !m_instance.get() )
{ {
m_instance = boost::shared_ptr< WGEColormapping >( new WGEColormapping() ); m_instance = boost::shared_ptr< WGEColormapping >( new WGEColormapping() );
} }
...@@ -95,15 +95,23 @@ void WGEColormapping::callback( osg::Node* node ) ...@@ -95,15 +95,23 @@ void WGEColormapping::callback( osg::Node* node )
{ {
// get node info // get node info
NodeInfoContainerType::ReadTicket r = m_nodeInfo.getReadTicket(); NodeInfoContainerType::ReadTicket r = m_nodeInfo.getReadTicket();
NodeInfo info = r->get().find( node )->second; // what if find is the last element in the map? then there wont be a second
r.reset(); std::map< osg::Node*, NodeInfo >::const_iterator found = r->get().find( node );
NodeInfo info;
// need (re-)binding? if ( found != r->get().end() )
if ( info.m_initial || m_texUpdate )
{ {
TextureContainerType::ReadTicket rt = m_textures.getReadTicket(); info = found->second;
// implement
rt.reset(); // need (re-)binding?
if ( info.m_initial || m_texUpdate )
{
TextureContainerType::ReadTicket rt = m_textures.getReadTicket();
// 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