From 82f147367fb5e4ee4bbe53db01856ea375058825 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 19 Sep 2013 11:10:59 -0400 Subject: SH-3455 WIP - removing bake upload code --- indra/llappearance/llwearable.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) mode change 100644 => 100755 indra/llappearance/llwearable.cpp (limited to 'indra/llappearance/llwearable.cpp') diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp old mode 100644 new mode 100755 index d86a460511..525a782ba0 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -524,7 +524,7 @@ void LLWearable::revertValues() LLVisualParam *param = getVisualParam(id); if(param && !dynamic_cast(param) ) { - setVisualParamWeight(id, value, TRUE); + setVisualParamWeight(id, value); } } @@ -536,7 +536,7 @@ void LLWearable::revertValues() LLVisualParam *param = getVisualParam(id); if(param && dynamic_cast(param) ) { - setVisualParamWeight(id, value, TRUE); + setVisualParamWeight(id, value); } } @@ -646,12 +646,12 @@ void LLWearable::addVisualParam(LLVisualParam *param) } -void LLWearable::setVisualParamWeight(S32 param_index, F32 value, BOOL upload_bake) +void LLWearable::setVisualParamWeight(S32 param_index, F32 value) { if( is_in_map(mVisualParamIndexMap, param_index ) ) { LLVisualParam *wearable_param = mVisualParamIndexMap[param_index]; - wearable_param->setWeight(value, upload_bake); + wearable_param->setWeight(value); } else { @@ -692,14 +692,14 @@ void LLWearable::getVisualParams(visual_param_vec_t &list) } } -void LLWearable::animateParams(F32 delta, BOOL upload_bake) +void LLWearable::animateParams(F32 delta) { for(visual_param_index_map_t::iterator iter = mVisualParamIndexMap.begin(); iter != mVisualParamIndexMap.end(); ++iter) { LLVisualParam *param = (LLVisualParam*) iter->second; - param->animate(delta, upload_bake); + param->animate(delta); } } @@ -717,14 +717,14 @@ LLColor4 LLWearable::getClothesColor(S32 te) const return color; } -void LLWearable::setClothesColor( S32 te, const LLColor4& new_color, BOOL upload_bake ) +void LLWearable::setClothesColor( S32 te, const LLColor4& new_color) { U32 param_name[3]; if( LLAvatarAppearance::teToColorParams( (LLAvatarAppearanceDefines::ETextureIndex)te, param_name ) ) { for( U8 index = 0; index < 3; index++ ) { - setVisualParamWeight(param_name[index], new_color.mV[index], upload_bake); + setVisualParamWeight(param_name[index], new_color.mV[index]); } } } @@ -743,7 +743,7 @@ void LLWearable::writeToAvatar(LLAvatarAppearance* avatarp) S32 param_id = param->getID(); F32 weight = getVisualParamWeight(param_id); - avatarp->setVisualParamWeight( param_id, weight, FALSE ); + avatarp->setVisualParamWeight( param_id, weight); } } } -- cgit v1.2.3 From 75538968dbc224a956115762a67e5da20c1d369f Mon Sep 17 00:00:00 2001 From: Stinson Linden Date: Wed, 14 May 2014 19:49:13 +0100 Subject: MAINT-4009: Patching the final leak of LLViewerFetchedTexture objects occurring because the LLWearable class was not properly destroying itself. --- indra/llappearance/llwearable.cpp | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'indra/llappearance/llwearable.cpp') 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(); } -- cgit v1.2.3 From 76023f172c2a8eeb5c8d6b55119ef3e8faf8cc6f Mon Sep 17 00:00:00 2001 From: Stinson Linden Date: Wed, 14 May 2014 22:55:19 +0100 Subject: MAINT-4009: Patching a leak of LLVisualParam derived objects that were being leaked because the LLWearable class was not destroying itself properly. --- indra/llappearance/llwearable.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/llappearance/llwearable.cpp') 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(); } -- cgit v1.2.3