From f73e0d09aabd17f778ce802353dea5c5aae007be Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 30 Apr 2025 23:45:22 +0300 Subject: #3905 Crashes in LLInventoryModel::saveToFile I don't expect it to fix the problem. Just making things more explicit in places of most frequent crashes. --- indra/newview/llinventorymodel.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 0b2615c706..c7cc8f3032 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -3500,7 +3500,9 @@ bool LLInventoryModel::saveToFile(const std::string& filename, { if (cat->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN) { - fileXML << LLSDOStreamer(cat->exportLLSD()) << std::endl; + LLSD sd = LLSD::emptyMap(); + cat->exportLLSD(sd); + fileXML << LLSDOStreamer(sd) << std::endl; cat_count++; } @@ -3514,7 +3516,9 @@ bool LLInventoryModel::saveToFile(const std::string& filename, auto it_count = items.size(); for (auto& item : items) { - fileXML << LLSDOStreamer(item->asLLSD()) << std::endl; + LLSD sd = LLSD::emptyMap(); + item->asLLSD(sd); + fileXML << LLSDOStreamer(sd) << std::endl; if (fileXML.fail()) { -- cgit v1.2.3 From 2cbff073edad0bb31d2a025b888a9fb2e90fe2cf Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 20 May 2025 20:40:04 +0300 Subject: #4000 Cherry pick inventory LEAP functions from develop branch --- indra/newview/llinventorymodel.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index c7cc8f3032..110957dfa7 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1282,6 +1282,10 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id, { for (auto& cat : *cat_array) { + if (add.exceedsLimit()) + { + break; + } if(add(cat,NULL)) { cats.push_back(cat); @@ -1297,6 +1301,10 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id, { for (auto& item : *item_array) { + if (add.exceedsLimit()) + { + break; + } if(add(NULL, item)) { items.push_back(item); -- cgit v1.2.3