Просмотр исходного кода

make json sub-dictionaries shared, fixes #2381

Juan Linietsky 9 лет назад
Родитель
Сommit
6b1849d29b
2 измененных файлов с 3 добавлено и 2 удалено
  1. 2 2
      core/io/json.cpp
  2. 1 0
      tools/editor/array_property_edit.cpp

+ 2 - 2
core/io/json.cpp

@@ -288,7 +288,7 @@ Error JSON::_parse_value(Variant &value,Token& token,const CharType *p_str,int &
 
 	if (token.type==TK_CURLY_BRACKET_OPEN) {
 
-		Dictionary d;
+		Dictionary d(true);
 		Error err = _parse_object(d,p_str,index,p_len,line,r_err_str);
 		if (err)
 			return err;
@@ -296,7 +296,7 @@ Error JSON::_parse_value(Variant &value,Token& token,const CharType *p_str,int &
 		return OK;
 	} else if (token.type==TK_BRACKET_OPEN) {
 
-		Array a;
+		Array a(true);
 		Error err = _parse_array(a,p_str,index,p_len,line,r_err_str);
 		if (err)
 			return err;

+ 1 - 0
tools/editor/array_property_edit.cpp

@@ -92,6 +92,7 @@ bool ArrayPropertyEdit::_set(const StringName& p_name, const Variant& p_value){
 			_change_notify();
 			return true;
 		}
+
 	} else if (pn.begins_with("indices")) {
 
 		if (pn.find("_")!=-1) {