Hi Robert,
Good. This also works for me in the osgterrain-crash-program.
I've updated our patches to match this fix, and our internal tests also
pass.
Thanks for taking the time and sharing this great software!
Ola
On Fri, 31 Aug 2012 18:03:33 +0200, Robert Osfield
<[email protected]> wrote:
Hi Ola, Brad et. al,
I have just checked in a fix, similar to Ola's suggested fix, with
this fix I can't get Ola's modified osgterrain to crash and when the
code had debugging code in place it showed that it was detected the
problem TerrainTile's that were being deleted and correctly handled
these. The code block of interest is now:
{
OpenThreads::ScopedLock<OpenThreads::ReentrantMutex>
lock(_mutex);
for(TerrainTileSet::iterator itr =
_updateTerrainTileSet.begin(); itr !=_updateTerrainTileSet.end();
++itr)
{
// take a reference first to make sure that the
referenceCount can be safely read without another thread decrementing
it to zero.
(*itr)->ref();
// only if referenceCount is 2 or more indicating
there is still a reference held elsewhere is it safe to add it to list
of tiles to be updated
if ((*itr)->referenceCount()>1)
tiles.push_back(*itr);
// use unref_nodelete to avoid any issues when the
*itr TerrainTile has been deleted by another thread while this for
loop has been running.
(*itr)->unref_nodelete();
}
_updateTerrainTileSet.clear();
}
Could you please try out the svn/trunk version of the OSG and let me
know how you get on,
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
Using Opera's revolutionary email client: http://www.opera.com/mail/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org