summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-01-10 10:00:58 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-01-10 10:00:58 -0300
commit6c8cf306978d694b51f3cdabea43a6774b1fc055 (patch)
treedad5b3ded240fec3ec05392e234005f3459e617f /core/io
parentf5a3c1ccdeece4fa7832e7998f21448e2d9aafa7 (diff)
-fix stray file left open when parsing configuration, closes #3299
Diffstat (limited to 'core/io')
-rw-r--r--core/io/config_file.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/io/config_file.cpp b/core/io/config_file.cpp
index f2d6f78664..fd20ec9404 100644
--- a/core/io/config_file.cpp
+++ b/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);