Skip to content
Snippets Groups Projects
Commit 76023f17 authored by Stinson Linden's avatar Stinson Linden
Browse files

MAINT-4009: Patching a leak of LLVisualParam derived objects that were being...

MAINT-4009: Patching a leak of LLVisualParam derived objects that were being leaked because the LLWearable class was not destroying itself properly.
parent 75538968
No related branches found
No related tags found
No related merge requests found
......@@ -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();
}
......
......@@ -178,7 +178,10 @@ LLVisualParam::LLVisualParam()
//-----------------------------------------------------------------------------
LLVisualParam::~LLVisualParam()
{
delete mNext;
if (mNext != NULL)
{
delete mNext;
}
}
/*
......@@ -284,6 +287,14 @@ void LLVisualParam::setNextParam( LLVisualParam *next )
mNext = next;
}
//-----------------------------------------------------------------------------
// clearNextParam()
//-----------------------------------------------------------------------------
void LLVisualParam::clearNextParam()
{
mNext = NULL;
}
//-----------------------------------------------------------------------------
// animate()
//-----------------------------------------------------------------------------
......
......@@ -155,6 +155,7 @@ class LLVisualParam
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; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment