summaryrefslogtreecommitdiff
path: root/indra/llcharacter
diff options
context:
space:
mode:
authorStinson Linden <stinson@lindenlab.com>2014-05-23 21:56:44 +0100
committerStinson Linden <stinson@lindenlab.com>2014-05-23 21:56:44 +0100
commit0160c514c5e0bc3e575b33ef27924a9c8c7c30cf (patch)
treecd181ea27a9193911ed6f3904345af4871464bcc /indra/llcharacter
parenta13d2f7f706bc8d5a4ea103cde56bacea1dd82cc (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')
-rwxr-xr-xindra/llcharacter/llvisualparam.cpp29
-rwxr-xr-xindra/llcharacter/llvisualparam.h2
2 files changed, 23 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;
}
/*
diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h
index 78c776705f..e49b1225c3 100755
--- a/indra/llcharacter/llvisualparam.h
+++ b/indra/llcharacter/llvisualparam.h
@@ -166,6 +166,8 @@ public:
EParamLocation getParamLocation() const { return mParamLocation; }
protected:
+ LLVisualParam(const LLVisualParam& pOther);
+
F32 mCurWeight; // current weight
F32 mLastWeight; // last weight
LLVisualParam* mNext; // next param in a shared chain