summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-04-02 00:38:51 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-04-02 16:23:46 +0300
commitdcc77324736c84705fdde1056b7ae04c583b9db1 (patch)
tree4c02f250d092581b57c4a7b5e93ad3b69041e052 /indra/newview/llinventorybridge.cpp
parenta93344b4db2654e91b4daa9f2709daf448c03a8e (diff)
viewer#1104 Crash at populateFoldersList
Ensure folder creation callbacks remain alive
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 932a0316dd..0ed89292a5 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -5118,7 +5118,7 @@ void LLFolderBridge::dropToMyOutfits(LLInventoryCategory* inv_cat, LLPointer<LLI
// Note: creation will take time, so passing folder id to callback is slightly unreliable,
// but so is collecting and passing descendants' ids
- inventory_func_type func = boost::bind(&LLFolderBridge::outfitFolderCreatedCallback, this, inv_cat->getUUID(), _1, cb);
+ inventory_func_type func = boost::bind(outfitFolderCreatedCallback, inv_cat->getUUID(), _1, cb, mInventoryPanel);
gInventory.createNewCategory(dest_id,
LLFolderType::FT_OUTFIT,
inv_cat->getName(),
@@ -5126,11 +5126,25 @@ void LLFolderBridge::dropToMyOutfits(LLInventoryCategory* inv_cat, LLPointer<LLI
inv_cat->getThumbnailUUID());
}
-void LLFolderBridge::outfitFolderCreatedCallback(LLUUID cat_source_id, LLUUID cat_dest_id, LLPointer<LLInventoryCallback> cb)
+void LLFolderBridge::outfitFolderCreatedCallback(LLUUID cat_source_id,
+ LLUUID cat_dest_id,
+ LLPointer<LLInventoryCallback> cb,
+ LLHandle<LLInventoryPanel> inventory_panel)
{
LLInventoryModel::cat_array_t* categories;
LLInventoryModel::item_array_t* items;
- getInventoryModel()->getDirectDescendentsOf(cat_source_id, categories, items);
+
+ LLInventoryPanel* panel = inventory_panel.get();
+ if (!panel)
+ {
+ return;
+ }
+ LLInventoryModel* model = panel->getModel();
+ if (!model)
+ {
+ return;
+ }
+ model->getDirectDescendentsOf(cat_source_id, categories, items);
LLInventoryObject::const_object_list_t link_array;