Hi Pjotr,

I am bit torn with this change as ref_ptr<> usage is in theory a more
robust way to code - but as you point out other places in CullVisitor.cpp
use just a plain C pointer in the same circumstances.  Performance wise a C
pointer is better for sure, even if the differences is very small, and for
the code blocks changed other containers retain a ref_ptr<> so it's only
it's only for a couple of CPU operations is the ref counted updated so that
actual risk of a memory leak is theoretical.  On balance, for a scene
graph, performance on relatively commonly invoked code trumps "good code"
practices, so I've merged the change and have checked it into svn/trunk.

Cheers,
Robert.




On 16 July 2014 15:10, Pjotr Svetachov <[email protected]> wrote:

> Hi Robert,
>
> I think I spotted some unneeded ref_ptrs in the cullvisitor. The call
> pushModelViewMatrix or pushProjectionMatrix will already keep the
> reference when adding it to the MatrixStack. In CullVisitor::apply
> methods for the billboard and the camera you already take a pointer
> instead of a ref_ptr.
>
> Cheers,
> Pjotr
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to