diff options
author | Stinson Linden <stinson@lindenlab.com> | 2014-05-23 21:56:44 +0100 |
---|---|---|
committer | Stinson Linden <stinson@lindenlab.com> | 2014-05-23 21:56:44 +0100 |
commit | 0160c514c5e0bc3e575b33ef27924a9c8c7c30cf (patch) | |
tree | cd181ea27a9193911ed6f3904345af4871464bcc /indra/llcharacter/llvisualparam.cpp | |
parent | a13d2f7f706bc8d5a4ea103cde56bacea1dd82cc (diff) |
MAINT-4077: Refactoring to add copy constructors to the LLVisualParam class and all of its derived descendants in order to clarify ownership of memory pointers.
Diffstat (limited to 'indra/llcharacter/llvisualparam.cpp')
-rwxr-xr-x | indra/llcharacter/llvisualparam.cpp | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/indra/llcharacter/llvisualparam.cpp b/indra/llcharacter/llvisualparam.cpp index dd87847c18..4f7898ef49 100755 --- a/indra/llcharacter/llvisualparam.cpp +++ b/indra/llcharacter/llvisualparam.cpp @@ -159,29 +159,42 @@ void LLVisualParamInfo::toStream(std::ostream &out) //----------------------------------------------------------------------------- // LLVisualParam() //----------------------------------------------------------------------------- -LLVisualParam::LLVisualParam() - : - mCurWeight( 0.f ), +LLVisualParam::LLVisualParam() + : mCurWeight( 0.f ), mLastWeight( 0.f ), mNext( NULL ), mTargetWeight( 0.f ), mIsAnimating( FALSE ), + mIsDummy(FALSE), mID( -1 ), mInfo( 0 ), - mIsDummy(FALSE), mParamLocation(LOC_UNKNOWN) { } //----------------------------------------------------------------------------- +// LLVisualParam() +//----------------------------------------------------------------------------- +LLVisualParam::LLVisualParam(const LLVisualParam& pOther) + : mCurWeight(pOther.mCurWeight), + mLastWeight(pOther.mLastWeight), + mNext(pOther.mNext), + mTargetWeight(pOther.mTargetWeight), + mIsAnimating(pOther.mIsAnimating), + mIsDummy(pOther.mIsDummy), + mID(pOther.mID), + mInfo(pOther.mInfo), + mParamLocation(pOther.mParamLocation) +{ +} + +//----------------------------------------------------------------------------- // ~LLVisualParam() //----------------------------------------------------------------------------- LLVisualParam::~LLVisualParam() { - if (mNext != NULL) - { - delete mNext; - } + delete mNext; + mNext = NULL; } /* |