summaryrefslogtreecommitdiff
path: root/indra/llinventory/llinventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llinventory/llinventory.cpp')
-rwxr-xr-xindra/llinventory/llinventory.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index d2efda8612..61ba0939bf 100755
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -72,17 +72,20 @@ const LLUUID MAGIC_ID("3c115e51-04f4-523c-9fa6-98aff1034730");
LLInventoryObject::LLInventoryObject(const LLUUID& uuid,
const LLUUID& parent_uuid,
LLAssetType::EType type,
- const std::string& name) :
+ const std::string& name)
+: LLTrace::MemTrackable<LLInventoryObject>("LLInventoryObject"),
mUUID(uuid),
mParentUUID(parent_uuid),
mType(type),
mName(name),
mCreationDate(0)
{
+ claimMem(mName);
correctInventoryName(mName);
}
-LLInventoryObject::LLInventoryObject() :
+LLInventoryObject::LLInventoryObject()
+: LLTrace::MemTrackable<LLInventoryObject>("LLInventoryObject"),
mType(LLAssetType::AT_NONE),
mCreationDate(0)
{
@@ -97,7 +100,9 @@ void LLInventoryObject::copyObject(const LLInventoryObject* other)
mUUID = other->mUUID;
mParentUUID = other->mParentUUID;
mType = other->mType;
+ disclaimMem(mName);
mName = other->mName;
+ claimMem(mName);
}
const LLUUID& LLInventoryObject::getUUID() const
@@ -150,7 +155,9 @@ void LLInventoryObject::rename(const std::string& n)
correctInventoryName(new_name);
if( !new_name.empty() && new_name != mName )
{
+ disclaimMem(mName);
mName = new_name;
+ claimMem(mName);
}
}
@@ -326,6 +333,8 @@ LLInventoryItem::LLInventoryItem(const LLUUID& uuid,
LLStringUtil::replaceNonstandardASCII(mDescription, ' ');
LLStringUtil::replaceChar(mDescription, '|', ' ');
+ claimMem(mDescription);
+
mPermissions.initMasks(inv_type);
}
@@ -357,7 +366,9 @@ void LLInventoryItem::copyItem(const LLInventoryItem* other)
copyObject(other);
mPermissions = other->mPermissions;
mAssetUUID = other->mAssetUUID;
+ disclaimMem(mDescription);
mDescription = other->mDescription;
+ claimMem(mDescription);
mSaleInfo = other->mSaleInfo;
mInventoryType = other->mInventoryType;
mFlags = other->mFlags;
@@ -432,7 +443,9 @@ void LLInventoryItem::setDescription(const std::string& d)
LLStringUtil::replaceChar(new_desc, '|', ' ');
if( new_desc != mDescription )
{
+ disclaimMem(mDescription);
mDescription = new_desc;
+ claimMem(mDescription);
}
}
@@ -713,7 +726,9 @@ BOOL LLInventoryItem::importFile(LLFILE* fp)
valuestr[0] = '\000';
}
+ disclaimMem(mDescription);
mDescription.assign(valuestr);
+ claimMem(mDescription);
LLStringUtil::replaceNonstandardASCII(mDescription, ' ');
/* TODO -- ask Ian about this code
const char *donkey = mDescription.c_str();
@@ -919,8 +934,10 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream)
valuestr[0] = '\000';
}
+ disclaimMem(mDescription);
mDescription.assign(valuestr);
LLStringUtil::replaceNonstandardASCII(mDescription, ' ');
+ claimMem(mDescription);
/* TODO -- ask Ian about this code
const char *donkey = mDescription.c_str();
if (donkey[0] == '|')
@@ -1160,8 +1177,10 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd)
w = INV_DESC_LABEL;
if (sd.has(w))
{
+ disclaimMem(mDescription);
mDescription = sd[w].asString();
LLStringUtil::replaceNonstandardASCII(mDescription, ' ');
+ claimMem(mDescription);
}
w = INV_CREATION_DATE_LABEL;
if (sd.has(w))