summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2016-11-02 17:19:40 +0200
committerMnikolenko Productengine <mnikolenko@productengine.com>2016-11-02 17:19:40 +0200
commita210ae50b03bae60e825b76c200980a31c9c93d8 (patch)
treebc14e5a8af6e6c2c8d458333c99294ff85aea05d /indra
parent26e73e2f5822bde8ece0c01ba6445bbe0f042180 (diff)
MAINT-6884 Issues with the Outfit Gallery and viewer crashes - out of memory crashes since VOB
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llinventoryobserver.cpp25
-rw-r--r--indra/newview/llinventoryobserver.h4
-rw-r--r--indra/newview/lloutfitgallery.cpp2
3 files changed, 25 insertions, 6 deletions
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);