[osg-users] CullVisitor object not getting properly deleted

Rick Irons Rick.Irons at mathworks.com
Thu May 26 14:04:20 PDT 2016


Hi Robert,



Unfortunately the fix didn't address the crash I am encountering.  The issue of the dynamic cast in objectDeleted() (\openscenegraph\src\osgUtil\CullVisitor.cpp) failing remains...



        virtual void objectDeleted(void* object)

        {

            osg::Referenced* ref = reinterpret_cast<osg::Referenced*>(object);

            osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>(ref);



            OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);



            RenderStageMap::iterator itr = _renderStageMap.find(cv);

            if (itr!=_renderStageMap.end())

            {

                _renderStageMap.erase(itr);

            }

        }



I was going to define our object that inherits from the CullVisitor as an osg::ref_ptr.  Perhaps doing so will delay the freeing of the CullVisitor object long enough within the CullVisitor destructor so that the problematic dynamic cast will succeed.  I am open to any other suggestions as well.  I may have to resort to just creating a small example program that reproduces the issue.



Thanks,

Rick



-----Original Message-----
From: Rick Irons
Sent: Wednesday, May 25, 2016 5:56 AM
To: OpenSceneGraph Users <osg-users at lists.openscenegraph.org>
Subject: Re: [osg-users] CullVisitor object not getting properly deleted



Hi Robert,



Thanks for the update.   I will try out the fix.



Rick



> On May 24, 2016, at 3:53 PM, Robert Osfield <robert.osfield at gmail.com<mailto:robert.osfield at gmail.com>> wrote:

>

> Hi Rick,

>

> After a preplexing day looking at how the osgUtiil::CullVisitor,

> osg::Camera and RenderStageCache were all interacting via the

> osg::Observer system I finally fixed the problem with the crash that

> I've see with the osgoit and osgprerender examples.   As the crash

> looks similar to what you saw there is reasonable chance that the

> changes should work for you too.

>

> I have checked my fix into master and OpenSceneGraph-3.4.

>

> Robert.

> _______________________________________________

> osg-users mailing list

> osg-users at lists.openscenegraph.org<mailto:osg-users at lists.openscenegraph.org>

> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.

> org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160526/0d9d5e68/attachment-0002.htm>


More information about the osg-users mailing list