From be3c6747a88d8bbb2c6b87c9eb97b14a42b90ae7 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 22 Nov 2011 11:53:44 -0700 Subject: remove redundant memory allocation for sh-2651: [crashhunters] Crash after google translate failure --- indra/llxml/llxmlnode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llxml') diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp index 9f1e249ddd..4362c88c4e 100644 --- a/indra/llxml/llxmlnode.cpp +++ b/indra/llxml/llxmlnode.cpp @@ -1277,7 +1277,7 @@ bool LLXMLNode::getAttribute(const LLStringTableEntry* name, LLXMLNodePtr& node, { return mDefault->getAttribute(name, node, FALSE); } - node = new LLXMLNode(); + return false; } -- cgit v1.2.3 From 2851cd519338ef4a1fde15da8d4015ab4380d6cb Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 28 Nov 2011 11:33:49 -0700 Subject: a try fix for sh-2651: [crashhunters] Crash after google translate failure and sh-2658: crash in LLPluginMessage::parse --- indra/llxml/llxmlnode.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llxml') diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp index 4362c88c4e..2b4a0fc2a1 100644 --- a/indra/llxml/llxmlnode.cpp +++ b/indra/llxml/llxmlnode.cpp @@ -693,7 +693,7 @@ bool LLXMLNode::parseFile(const std::string& filename, LLXMLNodePtr& node, LLXML LLFILE* fp = LLFile::fopen(filename, "rb"); /* Flawfinder: ignore */ if (fp == NULL) { - node = new LLXMLNode(); + node = NULL ; return false; } fseek(fp, 0, SEEK_END); @@ -746,7 +746,7 @@ bool LLXMLNode::parseBuffer( { llwarns << "Parse failure - wrong number of top-level nodes xml." << llendl; - node = new LLXMLNode(); + node = NULL ; return false; } @@ -805,7 +805,7 @@ bool LLXMLNode::parseStream( { llwarns << "Parse failure - wrong number of top-level nodes xml." << llendl; - node = new LLXMLNode(); + node = NULL; return false; } @@ -1206,7 +1206,7 @@ bool LLXMLNode::getChild(const LLStringTableEntry* name, LLXMLNodePtr& node, BOO { return mDefault->getChild(name, node, FALSE); } - node = new LLXMLNode(); + node = NULL; return false; } -- cgit v1.2.3 From e219fc30ba351e992c3c559f92830a4ca54ca2d3 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 23 Jan 2012 17:38:47 -0800 Subject: EXP-1837 FIX parsing notifications.xml during startup can take > 40 seconds (in non-release builds) removed O(n^2) comparisons of XML nodes in favor of O(n) --- indra/llxml/llxmlnode.cpp | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'indra/llxml') diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp index 2b4a0fc2a1..3d4e6f9a0b 100644 --- a/indra/llxml/llxmlnode.cpp +++ b/indra/llxml/llxmlnode.cpp @@ -631,13 +631,14 @@ bool LLXMLNode::updateNode( } //update all of node's children with updateNodes children that match name - LLXMLNodePtr child; + LLXMLNodePtr child = node->getFirstChild(); + LLXMLNodePtr last_child = child; LLXMLNodePtr updateChild; for (updateChild = update_node->getFirstChild(); updateChild.notNull(); updateChild = updateChild->getNextSibling()) { - for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) + while(child.notNull()) { std::string nodeName; std::string updateName; @@ -656,6 +657,22 @@ bool LLXMLNode::updateNode( if ((nodeName != "") && (updateName == nodeName)) { updateNode(child, updateChild); + last_child = child; + child = child->getNextSibling(); + if (child.isNull()) + { + child = node->getFirstChild(); + } + break; + } + + child = child->getNextSibling(); + if (child.isNull()) + { + child = node->getFirstChild(); + } + if (child == last_child) + { break; } } @@ -882,11 +899,8 @@ bool LLXMLNode::getLayeredXMLNode(LLXMLNodePtr& root, for (itor = paths.begin(), ++itor; itor != paths.end(); ++itor) { - std::string nodeName; - std::string updateName; - std::string layer_filename = *itor; - if(layer_filename.empty()) + if(layer_filename.empty() || layer_filename == filename) { // no localized version of this file, that's ok, keep looking continue; @@ -898,6 +912,9 @@ bool LLXMLNode::getLayeredXMLNode(LLXMLNodePtr& root, return false; } + std::string nodeName; + std::string updateName; + updateRoot->getAttributeString("name", updateName); root->getAttributeString("name", nodeName); -- cgit v1.2.3 From 5a14a67e060e7f325025e924c83489cfa236e3dc Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 1 Feb 2012 13:03:46 -0800 Subject: converted a bunch of narrowing implicit conversions to explicit --- indra/llxml/llxmlnode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llxml') diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp index 3d4e6f9a0b..2ffb0d8503 100644 --- a/indra/llxml/llxmlnode.cpp +++ b/indra/llxml/llxmlnode.cpp @@ -801,7 +801,7 @@ bool LLXMLNode::parseStream( while(str.good()) { str.read((char*)buffer, BUFSIZE); - int count = str.gcount(); + int count = (int)str.gcount(); if (XML_Parse(my_parser, (const char *)buffer, count, !str.good()) != XML_STATUS_OK) { -- cgit v1.2.3 From e328dcf4062177c903d3099d0d16477824d23025 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 6 Feb 2012 23:07:41 +0200 Subject: EXP-1849 FIXED Privacy settings could be set to default when modifying other preferences before login. --- indra/llxml/llcontrol.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llxml') diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h index bf38a8b062..597031ec70 100644 --- a/indra/llxml/llcontrol.h +++ b/indra/llxml/llcontrol.h @@ -92,6 +92,8 @@ typedef enum e_control_type class LLControlVariable : public LLRefCount { + LOG_CLASS(LLControlVariable); + friend class LLControlGroup; public: @@ -180,6 +182,8 @@ T convert_from_llsd(const LLSD& sd, eControlType type, const std::string& contro //const U32 STRING_CACHE_SIZE = 10000; class LLControlGroup : public LLInstanceTracker { + LOG_CLASS(LLControlGroup); + protected: typedef std::map ctrl_name_table_t; ctrl_name_table_t mNameTable; -- cgit v1.2.3