Daniele Bartolini пре 12 година
родитељ
комит
58f9182eb0
3 измењених фајлова са 8 додато и 2 уклоњено
  1. 1 2
      engine/Device.cpp
  2. 6 0
      engine/core/json/JSONParser.cpp
  3. 1 0
      engine/core/json/JSONParser.h

+ 1 - 2
engine/Device.cpp

@@ -542,8 +542,7 @@ void Device::read_engine_settings()
 	// Parse crown.config
 	JSONParser parser(json_string);
 
-	JSONElement root;
-	root = parser.root();
+	JSONElement root = parser.root();
 
 	// Boot
 	if (root.has_key("boot"))

+ 6 - 0
engine/core/json/JSONParser.cpp

@@ -203,6 +203,12 @@ JSONElement::JSONElement(JSONParser& parser, const char* at)
 {
 }
 
+//--------------------------------------------------------------------------
+JSONElement::JSONElement(const JSONElement& other)
+	: m_parser(other.m_parser), m_begin(other.m_at), m_at(other.m_at)
+{
+}
+
 //--------------------------------------------------------------------------
 JSONElement& JSONElement::operator=(const JSONElement& other)
 {

+ 1 - 0
engine/core/json/JSONParser.h

@@ -63,6 +63,7 @@ public:
 	/// obtained from JSONParser::root() or copied from an
 	/// already existent and valid element.
 						JSONElement();
+						JSONElement(const JSONElement& other);
 
 	JSONElement&		operator=(const JSONElement& other);