summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-04-08 02:42:39 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-04-08 02:56:34 +0300
commitd33328584f331287cce626804e10c962e7c3ce48 (patch)
tree86079b2bc25d171e4d4a7472e81e19d3e020e9cf /indra/newview/llinventoryfunctions.cpp
parentbb4967817e5e0251ebcbae861fcd998f22ce0c0c (diff)
SL-19529 Fix uninitialized variable and calback counter
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rw-r--r--indra/newview/llinventoryfunctions.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 00ff0e83c0..dd3750c152 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -1649,16 +1649,20 @@ void validate_marketplacelistings(
gInventory.createNewCategory(parent_uuid,
LLFolderType::FT_NONE,
cat->getName(),
- [cat_uuid, cb_result, cb_msg, fix_hierarchy, depth, notify_observers](const LLUUID &new_cat_id)
+ [cat_uuid, cb_result, cb_msg, fix_hierarchy, depth](const LLUUID &new_cat_id)
{
+ if (new_cat_id.isNull())
+ {
+ cb_result(0, false);
+ return;
+ }
LLInventoryCategory * move_cat = gInventory.getCategory(cat_uuid);
LLViewerInventoryCategory * viewer_cat = (LLViewerInventoryCategory *)(move_cat);
LLInventoryCategory * new_cat = gInventory.getCategory(new_cat_id);
gInventory.changeCategoryParent(viewer_cat, new_cat_id, false);
S32 pending = 0;
bool result = true;
- // notify_observers probably should be true in such case?
- validate_marketplacelistings(new_cat, cb_result, cb_msg, fix_hierarchy, depth + 1, notify_observers, pending, result);
+ validate_marketplacelistings(new_cat, cb_result, cb_msg, fix_hierarchy, depth + 1, true, pending, result);
cb_result(pending, result);
}
);
@@ -2306,8 +2310,11 @@ bool can_share_item(const LLUUID& item_id)
LLMarketplaceValidator::LLMarketplaceValidator()
+ : mPendingCallbacks(0)
+ , mValidationInProgress(false)
{
}
+
LLMarketplaceValidator::~LLMarketplaceValidator()
{
}
@@ -2335,7 +2342,7 @@ void LLMarketplaceValidator::start()
return;
}
mValidationInProgress = true;
- mPendingCallbacks = 1; // do '1' in case something decides ro callback immediately
+ mPendingCallbacks = 1; // do '1' in case something decides to callback immediately
const ValidationRequest &first = mValidationQueue.front();
LLViewerInventoryCategory* cat = gInventory.getCategory(first.mCategoryId);
@@ -2358,6 +2365,7 @@ void LLMarketplaceValidator::start()
}
};
+ S32 pending_calbacks = 0;
validate_marketplacelistings(
cat,
result_callback,
@@ -2365,10 +2373,10 @@ void LLMarketplaceValidator::start()
first.mFixHierarchy,
first.mDepth,
true,
- mPendingCallbacks,
+ pending_calbacks,
mPendingResult);
- result_callback(mPendingCallbacks, mPendingResult);
+ result_callback(pending_calbacks, mPendingResult);
}
LLMarketplaceValidator::ValidationRequest::ValidationRequest(