Sync with obsidian in attempt to fix SV-2086

Applies MAINT-4897 FIXED Frequent error when texturing a linkset - "Unable to add texture. Please wait a few seconds and try again."
Applies MAINT-5547 FIXED errors when texturing a linkset "Unable to add texture. Please wait a few seconds and try again."
This commit is contained in:
Lirusaito
2016-07-07 16:37:25 -04:00
parent a6e905020d
commit 873b399ee8
3 changed files with 38 additions and 22 deletions

View File

@@ -2594,6 +2594,11 @@ void LLViewerObject::clearInventoryListeners()
mInventoryCallbacks.clear();
}
bool LLViewerObject::hasInventoryListeners()
{
return !mInventoryCallbacks.empty();
}
void LLViewerObject::requestInventory()
{
if(mInventoryDirty && mInventory && !mInventoryCallbacks.empty())
@@ -2601,15 +2606,20 @@ void LLViewerObject::requestInventory()
mInventory->clear(); // will deref and delete entries
delete mInventory;
mInventory = NULL;
mInventoryDirty = FALSE; //since we are going to request it now
}
if(mInventory)
{
// inventory is either up to date or doesn't has a listener
// if it is dirty, leave it this way in case we gain a listener
doInventoryCallback();
}
// throw away duplicate requests
else
{
// since we are going to request it now
mInventoryDirty = FALSE;
// Note: throws away duplicate requests
fetchInventoryFromServer();
}
}
@@ -2619,8 +2629,6 @@ void LLViewerObject::fetchInventoryFromServer()
if (!mInventoryPending)
{
delete mInventory;
mInventory = NULL;
mInventoryDirty = FALSE;
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_RequestTaskInventory);
msg->nextBlockFast(_PREHASH_AgentData);