From: Torsten Dreyer Date: Sun, 25 Dec 2011 19:11:06 +0000 (+0100) Subject: Use of copy-constructors X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=aef8f13290c74359c1a7a54bd5e6e375b3f0c49e;p=simgear.git Use of copy-constructors explicitly initialize the base class in a copy-constructor instead of implicitly calling the default constructor. --- diff --git a/simgear/props/props.cxx b/simgear/props/props.cxx index 499d417f..5fe9bc90 100644 --- a/simgear/props/props.cxx +++ b/simgear/props/props.cxx @@ -664,7 +664,8 @@ SGPropertyNode::SGPropertyNode () * Copy constructor. */ SGPropertyNode::SGPropertyNode (const SGPropertyNode &node) - : _index(node._index), + : SGReferenced(node), + _index(node._index), _name(node._name), _parent(0), // don't copy the parent _type(node._type), diff --git a/simgear/scene/material/Effect.cxx b/simgear/scene/material/Effect.cxx index 3736782a..c021b98e 100644 --- a/simgear/scene/material/Effect.cxx +++ b/simgear/scene/material/Effect.cxx @@ -90,7 +90,7 @@ Effect::Effect() } Effect::Effect(const Effect& rhs, const CopyOp& copyop) - : root(rhs.root), parametersProp(rhs.parametersProp), _cache(0), + : osg::Object(rhs,copyop), root(rhs.root), parametersProp(rhs.parametersProp), _cache(0), _isRealized(rhs._isRealized) { typedef vector > TechniqueList; diff --git a/simgear/scene/material/EffectCullVisitor.cxx b/simgear/scene/material/EffectCullVisitor.cxx index efac70b7..e2d19920 100644 --- a/simgear/scene/material/EffectCullVisitor.cxx +++ b/simgear/scene/material/EffectCullVisitor.cxx @@ -36,6 +36,7 @@ EffectCullVisitor::EffectCullVisitor() } EffectCullVisitor::EffectCullVisitor(const EffectCullVisitor& rhs) : + osg::Referenced(rhs), CullVisitor(rhs) { } diff --git a/simgear/scene/material/Technique.cxx b/simgear/scene/material/Technique.cxx index aeab9cf3..a540fb2f 100644 --- a/simgear/scene/material/Technique.cxx +++ b/simgear/scene/material/Technique.cxx @@ -58,6 +58,7 @@ Technique::Technique(bool alwaysValid) } Technique::Technique(const Technique& rhs, const osg::CopyOp& copyop) : + osg::Object(rhs,copyop), _contextMap(rhs._contextMap), _alwaysValid(rhs._alwaysValid), _shadowingStateSet(copyop(rhs._shadowingStateSet.get())), _validExpression(rhs._validExpression), diff --git a/simgear/scene/material/Technique.hxx b/simgear/scene/material/Technique.hxx index b2ce020f..b2895cd1 100644 --- a/simgear/scene/material/Technique.hxx +++ b/simgear/scene/material/Technique.hxx @@ -103,7 +103,7 @@ protected: struct ContextInfo : public osg::Referenced { ContextInfo() : valid(UNKNOWN) {} - ContextInfo(const ContextInfo& rhs) : valid(rhs.valid()) {} + ContextInfo(const ContextInfo& rhs) : osg::Referenced(rhs), valid(rhs.valid()) {} ContextInfo& operator=(const ContextInfo& rhs) { valid = rhs.valid; diff --git a/simgear/scene/util/SGSceneUserData.hxx b/simgear/scene/util/SGSceneUserData.hxx index 1296e9c3..d0c69d03 100644 --- a/simgear/scene/util/SGSceneUserData.hxx +++ b/simgear/scene/util/SGSceneUserData.hxx @@ -34,7 +34,8 @@ public: SGSceneUserData() {} SGSceneUserData(const SGSceneUserData& rhs, const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY) - : _bvhNode(rhs._bvhNode), _velocity(rhs._velocity), + : osg::Object(rhs,copyOp), + _bvhNode(rhs._bvhNode), _velocity(rhs._velocity), _pickCallbacks(rhs._pickCallbacks) { }