From a95773beef5f65ed66539c2800b0a5a2efd833cb Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 26 Feb 2017 03:15:57 +0100 Subject: [PATCH] Fix unnecessary copy of ParticleSystem in SceneUtil::CopyOp --- components/sceneutil/clone.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/sceneutil/clone.cpp b/components/sceneutil/clone.cpp index 26f3f5c7c..2c0ce98ba 100644 --- a/components/sceneutil/clone.cpp +++ b/components/sceneutil/clone.cpp @@ -38,7 +38,7 @@ namespace SceneUtil return operator()(processor); if (const osgParticle::ParticleSystemUpdater* updater = dynamic_cast(node)) { - osgParticle::ParticleSystemUpdater* cloned = osg::clone(updater, *this); + osgParticle::ParticleSystemUpdater* cloned = new osgParticle::ParticleSystemUpdater(*updater, osg::CopyOp::SHALLOW_COPY); mMap2[cloned] = updater->getParticleSystem(0); return cloned; } @@ -94,7 +94,7 @@ namespace SceneUtil osgParticle::ParticleProcessor* CopyOp::operator() (const osgParticle::ParticleProcessor* processor) const { - osgParticle::ParticleProcessor* cloned = osg::clone(processor, *this); + osgParticle::ParticleProcessor* cloned = osg::clone(processor, osg::CopyOp::SHALLOW_COPY); mMap[cloned] = processor->getParticleSystem(); return cloned; }