소스 검색

-fix stray file left open when parsing configuration, closes #3299

Juan Linietsky 9 년 전
부모
커밋
6c8cf30697
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      core/io/config_file.cpp

+ 3 - 1
core/io/config_file.cpp

@@ -180,8 +180,10 @@ Error ConfigFile::load(const String& p_path) {
 		next_tag.name=String();
 
 		err = VariantParser::parse_tag_assign_eof(&stream,lines,error_text,next_tag,assign,value,NULL,true);
-		if (err==ERR_FILE_EOF)
+		if (err==ERR_FILE_EOF) {
+			memdelete(f);
 			return OK;
+		}
 		else if (err!=OK) {
 			ERR_PRINTS("ConfgFile::load - "+p_path+":"+itos(lines)+" error: "+error_text);
 			memdelete(f);