summaryrefslogtreecommitdiff
path: root/indra/llxml
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2025-04-15 19:31:20 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2025-04-15 19:31:20 +0300
commitae931987356a71dbe8fc7ec31f2a2fe9108b4495 (patch)
treed8edd9820ad2848f4adebc310ffe25d6ec355885 /indra/llxml
parent5a893f262f6c8367e7098ac68f8d605e80695745 (diff)
parentcf2b4dbfb280986cf859b12fd55158d7b9e0ac3d (diff)
Merge branch 'main' into marchcat/maint-c-restore
# Conflicts: # indra/llcommon/lldate.h # indra/newview/llappviewer.cpp # indra/newview/llinventorybridge.cpp # indra/newview/llmaterialeditor.cpp # indra/newview/llviewerparceloverlay.cpp # indra/newview/llvoavatar.cpp
Diffstat (limited to 'indra/llxml')
-rw-r--r--indra/llxml/llxmlnode.cpp1
-rw-r--r--indra/llxml/llxmltree.cpp13
2 files changed, 9 insertions, 5 deletions
diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp
index 92bcb1a2ae..ec616cefbc 100644
--- a/indra/llxml/llxmlnode.cpp
+++ b/indra/llxml/llxmlnode.cpp
@@ -306,6 +306,7 @@ void LLXMLNode::addChild(LLXMLNodePtr& new_child)
// virtual
LLXMLNodePtr LLXMLNode::createChild(const char* name, bool is_attribute)
{
+ // Todo: validate to make sure node name is valid? (no spaces, etc)
return createChild(gStringTable.addStringEntry(name), is_attribute);
}
diff --git a/indra/llxml/llxmltree.cpp b/indra/llxml/llxmltree.cpp
index 164b3156e1..d66544d0f8 100644
--- a/indra/llxml/llxmltree.cpp
+++ b/indra/llxml/llxmltree.cpp
@@ -108,12 +108,15 @@ LLXmlTreeNode::LLXmlTreeNode( const std::string& name, LLXmlTreeNode* parent, LL
LLXmlTreeNode::~LLXmlTreeNode()
{
- attribute_map_t::iterator iter;
- for (iter=mAttributes.begin(); iter != mAttributes.end(); iter++)
- delete iter->second;
- for(LLXmlTreeNode* node : mChildren)
+ for (auto& attr : mAttributes)
+ {
+ delete attr.second;
+ }
+ mAttributes.clear();
+
+ for (auto& child : mChildren)
{
- delete node;
+ delete child;
}
mChildren.clear();
}