From 4ab93aeffe030993d10a5a1e4dd3cbb4bca7f152 Mon Sep 17 00:00:00 2001 From: bzzt Date: Wed, 20 Feb 2019 13:37:00 +0000 Subject: [PATCH] Do not allocate empty callbacks in the RigGeometry --- components/sceneutil/riggeometry.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/sceneutil/riggeometry.cpp b/components/sceneutil/riggeometry.cpp index 0c8198055..97c8e1d39 100644 --- a/components/sceneutil/riggeometry.cpp +++ b/components/sceneutil/riggeometry.cpp @@ -40,8 +40,8 @@ RigGeometry::RigGeometry() , mLastFrameNumber(0) , mBoundsFirstFrame(true) { - setUpdateCallback(new osg::Callback); // dummy to make sure getNumChildrenRequiringUpdateTraversal() is correct - // update done in accept(NodeVisitor&) + setNumChildrenRequiringUpdateTraversal(1); + // update done in accept(NodeVisitor&) } RigGeometry::RigGeometry(const RigGeometry ©, const osg::CopyOp ©op) @@ -54,6 +54,7 @@ RigGeometry::RigGeometry(const RigGeometry ©, const osg::CopyOp ©op) , mBoundsFirstFrame(true) { setSourceGeometry(copy.mSourceGeometry); + setNumChildrenRequiringUpdateTraversal(1); } void RigGeometry::setSourceGeometry(osg::ref_ptr sourceGeometry)