From a210ae50b03bae60e825b76c200980a31c9c93d8 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 2 Nov 2016 17:19:40 +0200 Subject: MAINT-6884 Issues with the Outfit Gallery and viewer crashes - out of memory crashes since VOB --- indra/newview/llinventoryobserver.cpp | 25 ++++++++++++++++++++++--- indra/newview/llinventoryobserver.h | 4 ++-- indra/newview/lloutfitgallery.cpp | 2 +- 3 files changed, 25 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index ce8705b7ac..4427f32de9 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -656,7 +656,7 @@ void LLInventoryCategoriesObserver::changed(U32 mask) } } -bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t cb) +bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t cb, bool init_name_hash) { S32 version = LLViewerInventoryCategory::VERSION_UNKNOWN; S32 current_num_known_descendents = LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN; @@ -694,8 +694,15 @@ bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t if (can_be_added) { - mCategoryMap.insert(category_map_value_t( - cat_id,LLCategoryData(cat_id, cb, version, current_num_known_descendents))); + if(init_name_hash) + { + LLMD5 item_name_hash = gInventory.hashDirectDescendentNames(cat_id); + mCategoryMap.insert(category_map_value_t(cat_id,LLCategoryData(cat_id, cb, version, current_num_known_descendents,item_name_hash))); + } + else + { + mCategoryMap.insert(category_map_value_t(cat_id,LLCategoryData(cat_id, cb, version, current_num_known_descendents))); + } } return can_be_added; @@ -718,6 +725,18 @@ LLInventoryCategoriesObserver::LLCategoryData::LLCategoryData( mItemNameHash.finalize(); } +LLInventoryCategoriesObserver::LLCategoryData::LLCategoryData( + const LLUUID& cat_id, callback_t cb, S32 version, S32 num_descendents, LLMD5 name_hash) + + : mCatID(cat_id) + , mCallback(cb) + , mVersion(version) + , mDescendentsCount(num_descendents) + , mIsNameHashInitialized(true) + , mItemNameHash(name_hash) +{ +} + void LLScrollOnRenameObserver::changed(U32 mask) { if (mask & LLInventoryObserver::LABEL) diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index 8cf6a6bdab..36d8ee3f59 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -267,14 +267,14 @@ public: * @return "true" if category was added, "false" if it could * not be found. */ - bool addCategory(const LLUUID& cat_id, callback_t cb); + bool addCategory(const LLUUID& cat_id, callback_t cb, bool init_name_hash = false); void removeCategory(const LLUUID& cat_id); protected: struct LLCategoryData { LLCategoryData(const LLUUID& cat_id, callback_t cb, S32 version, S32 num_descendents); - + LLCategoryData(const LLUUID& cat_id, callback_t cb, S32 version, S32 num_descendents, LLMD5 name_hash); callback_t mCallback; S32 mVersion; S32 mDescendentsCount; diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index 13eb148788..20be9962f1 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -498,7 +498,7 @@ void LLOutfitGallery::updateAddedCategory(LLUUID cat_id) // Start observing changes in "My Outfits" category. mOutfitsObserver->addCategory(cat_id, - boost::bind(&LLOutfitGallery::refreshOutfit, this, cat_id)); + boost::bind(&LLOutfitGallery::refreshOutfit, this, cat_id), true); outfit_category->fetch(); refreshOutfit(cat_id); -- cgit v1.2.3