summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llchathistory.cpp5
-rw-r--r--indra/newview/llpreviewnotecard.cpp3
-rw-r--r--indra/newview/llviewerobject.cpp27
3 files changed, 18 insertions, 17 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index f4e1943ea2..42283f0238 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -1103,10 +1103,7 @@ LLChatHistory::LLChatHistory(const LLChatHistory::Params& p)
LLSD LLChatHistory::getValue() const
{
- LLSD* text=new LLSD();
- text->assign(mEditor->getText());
- return *text;
-
+ return LLSD(mEditor->getText());
}
LLChatHistory::~LLChatHistory()
diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp
index 3fd4f51559..33656566d1 100644
--- a/indra/newview/llpreviewnotecard.cpp
+++ b/indra/newview/llpreviewnotecard.cpp
@@ -255,7 +255,7 @@ void LLPreviewNotecard::loadAsset()
else
{
LLHost source_sim = LLHost();
- LLSD* user_data = new LLSD();
+ LLSD* user_data = nullptr;
if (mObjectUUID.notNull())
{
LLViewerObject *objectp = gObjectList.findObject(mObjectUUID);
@@ -274,6 +274,7 @@ void LLPreviewNotecard::loadAsset()
mAssetStatus = PREVIEW_ASSET_LOADED;
return;
}
+ user_data = new LLSD();
user_data->with("taskid", mObjectUUID).with("itemid", mItemUUID);
}
else
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index aad6c14b4d..b2e2f23ca7 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -3233,36 +3233,39 @@ void LLViewerObject::processTaskInv(LLMessageSystem* msg, void** user_data)
return;
}
- LLFilenameAndTask* ft = new LLFilenameAndTask;
- ft->mTaskID = task_id;
// we can receive multiple task updates simultaneously, make sure we will not rewrite newer with older update
- msg->getS16Fast(_PREHASH_InventoryData, _PREHASH_Serial, ft->mSerial);
+ S16 serial = 0;
+ msg->getS16Fast(_PREHASH_InventoryData, _PREHASH_Serial, serial);
- if (ft->mSerial == object->mInventorySerialNum
- && ft->mSerial < object->mExpectedInventorySerialNum)
+ if (serial == object->mInventorySerialNum
+ && serial < object->mExpectedInventorySerialNum)
{
// Loop Protection.
// We received same serial twice.
// Viewer did some changes to inventory that couldn't be saved server side
// or something went wrong to cause serial to be out of sync.
// Drop xfer and restart after some time, assign server's value as expected
- LL_WARNS() << "Task inventory serial might be out of sync, server serial: " << ft->mSerial << " client expected serial: " << object->mExpectedInventorySerialNum << LL_ENDL;
- object->mExpectedInventorySerialNum = ft->mSerial;
+ LL_WARNS() << "Task inventory serial might be out of sync, server serial: " << serial << " client expected serial: " << object->mExpectedInventorySerialNum << LL_ENDL;
+ object->mExpectedInventorySerialNum = serial;
object->fetchInventoryDelayed(INVENTORY_UPDATE_WAIT_TIME_DESYNC);
}
- else if (ft->mSerial < object->mExpectedInventorySerialNum)
+ else if (serial < object->mExpectedInventorySerialNum)
{
// Out of date message, record to current serial for loop protection, but do not load it
// Drop xfer and restart after some time
- if (ft->mSerial < object->mInventorySerialNum)
+ if (serial < object->mInventorySerialNum)
{
LL_WARNS() << "Task serial decreased. Potentially out of order packet or desync." << LL_ENDL;
}
- object->mInventorySerialNum = ft->mSerial;
+ object->mInventorySerialNum = serial;
object->fetchInventoryDelayed(INVENTORY_UPDATE_WAIT_TIME_OUTDATED);
}
- else if (ft->mSerial >= object->mExpectedInventorySerialNum)
+ else if (serial >= object->mExpectedInventorySerialNum)
{
+ LLFilenameAndTask* ft = new LLFilenameAndTask;
+ ft->mTaskID = task_id;
+ ft->mSerial = serial;
+
// We received version we expected or newer. Load it.
object->mInventorySerialNum = ft->mSerial;
object->mExpectedInventorySerialNum = ft->mSerial;
@@ -3297,7 +3300,7 @@ void LLViewerObject::processTaskInv(LLMessageSystem* msg, void** user_data)
object->mRegionp->getHost(),
TRUE,
&LLViewerObject::processTaskInvFile,
- (void**)ft,
+ (void**)ft, // This takes ownership of ft
LLXferManager::HIGH_PRIORITY);
if (object->mInvRequestState == INVENTORY_XFER)
{