diff options
author | Merov Linden <merov@lindenlab.com> | 2013-11-26 12:04:01 -0800 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2013-11-26 12:04:01 -0800 |
commit | f0cbf849acd19e7c380b1b720b7f57a9bb9261c2 (patch) | |
tree | 4cc2dad5c91db2c7cc125fe09cf29d4abe68c6f1 /indra/newview/llinventoryobserver.cpp | |
parent | 2776f8ac486dc34ea56b43409efeb37e35af6510 (diff) |
ACME-3320 : Clearing deleted categories so not to pool on them forever
Diffstat (limited to 'indra/newview/llinventoryobserver.cpp')
-rwxr-xr-x | indra/newview/llinventoryobserver.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 2be1d7a757..16427f2016 100755 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -690,6 +690,8 @@ void LLInventoryCategoriesObserver::changed(U32 mask) if (!mCategoryMap.size()) return; + std::vector<LLUUID> deleted_categories_ids; + for (category_map_t::iterator iter = mCategoryMap.begin(); iter != mCategoryMap.end(); ++iter) @@ -702,6 +704,8 @@ void LLInventoryCategoriesObserver::changed(U32 mask) { llwarns << "Category : Category id = " << cat_id << " disappeared" << llendl; cat_data.mCallback(); + // Keep track of those deleted categories so we can remove them + deleted_categories_ids.push_back(cat_id); continue; } @@ -760,6 +764,12 @@ void LLInventoryCategoriesObserver::changed(U32 mask) if (cat_changed) cat_data.mCallback(); } + + // Remove deleted categories from the list + for (std::vector<LLUUID>::iterator deleted_id = deleted_categories_ids.begin(); deleted_id != deleted_categories_ids.end(); ++deleted_id) + { + removeCategory(*deleted_id); + } } bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t cb) |