diff options
author | Nicky <nicky.dasmijn@posteo.nl> | 2024-04-10 20:44:24 +0200 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-04-11 07:27:19 +0300 |
commit | 52f3f70ce887c0f8877de7a8439bf44a246e7f9a (patch) | |
tree | 0478fe5502e8f4da219d567c4ea7a6b83512a397 /indra/newview | |
parent | 72730609f371ae0417a2d117fdc9d805ce8858fb (diff) |
Make sure items get removed from maps before the item itself gets destroyed,
Otherwise the viewer ends with a dangling pointer in the map
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llinventorymodel.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 05aa2e423f..ab8d085ae5 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2050,8 +2050,8 @@ void LLInventoryModel::deleteObject(const LLUUID& id, bool fix_broken_links, boo { LL_WARNS(LOG_INV) << "Deleting cat " << id << " while it still has child cats" << LL_ENDL; } + mParentChildCategoryTree.erase(id); delete cat_list; - mParentChildCategoryTree.erase(id); } addChangedMask(LLInventoryObserver::REMOVE, id); @@ -5040,4 +5040,3 @@ void LLInventoryModel::FetchItemHttpHandler::processFailure(const char * const r << LLCoreHttpUtil::responseToString(response) << "]" << LL_ENDL; gInventory.notifyObservers(); } - diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index ab04a8589a..ae2236da3f 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -578,8 +578,8 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve if (model_item && view_item && viewmodel_item) { const LLUUID& idp = viewmodel_item->getUUID(); + removeItemID(idp); view_item->destroyView(); - removeItemID(idp); } LLInventoryObject const* objectp = mInventory->getObject(item_id); |