From a6ef1cd66b323292aa069a64e80a04aaa43f66be Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 23 May 2018 14:13:27 +0100 Subject: [PATCH] Fixed warning of RenderLeaf's having multiple references in CullVisitor::createOrReuseRenderLeaf() but forcing a clean up of the StateGraph at the end of RenderStage::draw() --- src/osgUtil/RenderStage.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/osgUtil/RenderStage.cpp b/src/osgUtil/RenderStage.cpp index 3787025fb..d8300d2e3 100644 --- a/src/osgUtil/RenderStage.cpp +++ b/src/osgUtil/RenderStage.cpp @@ -1314,6 +1314,9 @@ void RenderStage::draw(osg::RenderInfo& renderInfo,RenderLeaf*& previous) // pop the render stages camera. if (_camera.valid()) renderInfo.popCamera(); + + // clean up state graph to make sure RenderLeaf etc, can be reused + if (_rootStateGraph.valid()) _rootStateGraph->clean(); } void RenderStage::drawImplementation(osg::RenderInfo& renderInfo,RenderLeaf*& previous)