diff options
author | Stinson Linden <stinson@lindenlab.com> | 2014-06-02 22:32:16 +0100 |
---|---|---|
committer | Stinson Linden <stinson@lindenlab.com> | 2014-06-02 22:32:16 +0100 |
commit | 8392fde6f6a4dfdb2a78382f3587ecd5a6d937ff (patch) | |
tree | 5c0b89998c072175cd1d1cb3c429a127af8f04d6 /indra/llappearance/llwearable.cpp | |
parent | 4885c122eaf1b4e304ce598f308d806322efacfc (diff) | |
parent | 51e0cc8140a2cbe92363cb902144ccc9bf34b7c7 (diff) |
Pull and merge from ssh://hg@bitbucket.org/lindenlab/viewer-drtvwr-365.
Diffstat (limited to 'indra/llappearance/llwearable.cpp')
-rwxr-xr-x | indra/llappearance/llwearable.cpp | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index bacbc09aee..4bce3f99ed 100755 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -43,9 +43,32 @@ 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() { + 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(); } const std::string& LLWearable::getTypeLabel() const @@ -620,17 +643,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(); } |