summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llappearance/llwearable.cpp8
-rwxr-xr-xindra/llcharacter/llvisualparam.cpp13
-rwxr-xr-xindra/llcharacter/llvisualparam.h1
3 files changed, 21 insertions, 1 deletions
diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp
index 6749a85f3c..d064b2982c 100644
--- a/indra/llappearance/llwearable.cpp
+++ b/indra/llappearance/llwearable.cpp
@@ -60,6 +60,14 @@ LLWearable::LLWearable()
// virtual
LLWearable::~LLWearable()
{
+ for (visual_param_index_map_t::iterator vpIter = mVisualParamIndexMap.begin(); vpIter != mVisualParamIndexMap.end(); ++vpIter)
+ {
+ LLVisualParam* vp = vpIter->second;
+ vp->clearNextParam();
+ delete vp;
+ vpIter->second = NULL;
+ }
+
destroyTextures();
}
diff --git a/indra/llcharacter/llvisualparam.cpp b/indra/llcharacter/llvisualparam.cpp
index 0df7fb2bc3..dd87847c18 100755
--- a/indra/llcharacter/llvisualparam.cpp
+++ b/indra/llcharacter/llvisualparam.cpp
@@ -178,7 +178,10 @@ LLVisualParam::LLVisualParam()
//-----------------------------------------------------------------------------
LLVisualParam::~LLVisualParam()
{
- delete mNext;
+ if (mNext != NULL)
+ {
+ delete mNext;
+ }
}
/*
@@ -285,6 +288,14 @@ void LLVisualParam::setNextParam( LLVisualParam *next )
}
//-----------------------------------------------------------------------------
+// clearNextParam()
+//-----------------------------------------------------------------------------
+void LLVisualParam::clearNextParam()
+{
+ mNext = NULL;
+}
+
+//-----------------------------------------------------------------------------
// animate()
//-----------------------------------------------------------------------------
void LLVisualParam::animate( F32 delta, BOOL upload_bake )
diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h
index a4d9f93e56..78c776705f 100755
--- a/indra/llcharacter/llvisualparam.h
+++ b/indra/llcharacter/llvisualparam.h
@@ -155,6 +155,7 @@ public:
LLVisualParam* getNextParam() { return mNext; }
void setNextParam( LLVisualParam *next );
+ void clearNextParam();
virtual void setAnimating(BOOL is_animating) { mIsAnimating = is_animating && !mIsDummy; }
BOOL getAnimating() const { return mIsAnimating; }