diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-04-02 00:38:51 +0300 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2024-04-02 16:23:46 +0300 |
commit | dcc77324736c84705fdde1056b7ae04c583b9db1 (patch) | |
tree | 4c02f250d092581b57c4a7b5e93ad3b69041e052 /indra/newview/llfloatercreatelandmark.cpp | |
parent | a93344b4db2654e91b4daa9f2709daf448c03a8e (diff) |
viewer#1104 Crash at populateFoldersList
Ensure folder creation callbacks remain alive
Diffstat (limited to 'indra/newview/llfloatercreatelandmark.cpp')
-rw-r--r-- | indra/newview/llfloatercreatelandmark.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/indra/newview/llfloatercreatelandmark.cpp b/indra/newview/llfloatercreatelandmark.cpp index 7dc3e4afe3..351f4a844c 100644 --- a/indra/newview/llfloatercreatelandmark.cpp +++ b/indra/newview/llfloatercreatelandmark.cpp @@ -31,6 +31,7 @@ #include "llagent.h" #include "llagentui.h" #include "llcombobox.h" +#include "llfloaterreg.h" #include "llinventoryfunctions.h" #include "llinventoryobserver.h" #include "lllandmarkactions.h" @@ -286,8 +287,7 @@ void LLFloaterCreateLandmark::onCreateFolderClicked() std::string folder_name = resp["message"].asString(); if (!folder_name.empty()) { - inventory_func_type func = boost::bind(&LLFloaterCreateLandmark::folderCreatedCallback, this, _1); - gInventory.createNewCategory(mLandmarksID, LLFolderType::FT_NONE, folder_name, func); + gInventory.createNewCategory(mLandmarksID, LLFolderType::FT_NONE, folder_name, folderCreatedCallback); gInventory.notifyObservers(); } } @@ -296,7 +296,11 @@ void LLFloaterCreateLandmark::onCreateFolderClicked() void LLFloaterCreateLandmark::folderCreatedCallback(LLUUID folder_id) { - populateFoldersList(folder_id); + LLFloaterCreateLandmark* floater = LLFloaterReg::findTypedInstance<LLFloaterCreateLandmark>("add_landmark"); + if (floater && !floater->isDead()) + { + floater->populateFoldersList(folder_id); + } } void LLFloaterCreateLandmark::onSaveClicked() |