summaryrefslogtreecommitdiff
path: root/indra/llappearance
diff options
context:
space:
mode:
authorStinson Linden <stinson@lindenlab.com>2014-05-14 19:49:13 +0100
committerStinson Linden <stinson@lindenlab.com>2014-05-14 19:49:13 +0100
commit75538968dbc224a956115762a67e5da20c1d369f (patch)
tree1eeda7cbd60224e86df7f5ac33d916b4a3dcfff0 /indra/llappearance
parentb34cdbaa697f99673588d6b2f49fd917fed3ee09 (diff)
MAINT-4009: Patching the final leak of LLViewerFetchedTexture objects occurring because the LLWearable class was not properly destroying itself.
Diffstat (limited to 'indra/llappearance')
-rw-r--r--indra/llappearance/llwearable.cpp28
-rw-r--r--indra/llappearance/llwearable.h1
2 files changed, 19 insertions, 10 deletions
diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp
index 389505fa34..6749a85f3c 100644
--- a/indra/llappearance/llwearable.cpp
+++ b/indra/llappearance/llwearable.cpp
@@ -43,9 +43,24 @@ S32 LLWearable::sCurrentDefinitionVersion = 1;
// Private local functions
static std::string terse_F32_to_string(F32 f);
+LLWearable::LLWearable()
+ : mDefinitionVersion(-1),
+ mName(),
+ mDescription(),
+ mPermissions(),
+ mSaleInfo(),
+ mType(LLWearableType::WT_NONE),
+ mSavedVisualParamMap(),
+ mVisualParamIndexMap(),
+ mTEMap(),
+ mSavedTEMap()
+{
+}
+
// virtual
LLWearable::~LLWearable()
{
+ destroyTextures();
}
const std::string& LLWearable::getTypeLabel() const
@@ -620,17 +635,10 @@ void LLWearable::syncImages(te_map_t &src, te_map_t &dst)
void LLWearable::destroyTextures()
{
- for( te_map_t::iterator iter = mTEMap.begin(); iter != mTEMap.end(); ++iter )
- {
- LLLocalTextureObject *lto = iter->second;
- delete lto;
- }
+ std::for_each(mTEMap.begin(), mTEMap.end(), DeletePairedPointer());
mTEMap.clear();
- for( te_map_t::iterator iter = mSavedTEMap.begin(); iter != mSavedTEMap.end(); ++iter )
- {
- LLLocalTextureObject *lto = iter->second;
- delete lto;
- }
+
+ std::for_each(mSavedTEMap.begin(), mSavedTEMap.end(), DeletePairedPointer());
mSavedTEMap.clear();
}
diff --git a/indra/llappearance/llwearable.h b/indra/llappearance/llwearable.h
index 132c153bcd..96809aab58 100644
--- a/indra/llappearance/llwearable.h
+++ b/indra/llappearance/llwearable.h
@@ -46,6 +46,7 @@ class LLWearable
// Constructors and destructors
//--------------------------------------------------------------------
public:
+ LLWearable();
virtual ~LLWearable();
//--------------------------------------------------------------------