diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-01-10 09:59:14 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-01-10 09:59:14 -0300 |
commit | f5a3c1ccdeece4fa7832e7998f21448e2d9aafa7 (patch) | |
tree | b288b5bb5031b20472b0c4a58abdd5afc880a402 | |
parent | 3a3ce982b0157c21b4976a347d4c1c254093970f (diff) |
make sure file is closed if something fails
-rw-r--r-- | core/io/config_file.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/io/config_file.cpp b/core/io/config_file.cpp index d79a3d1288..f2d6f78664 100644 --- a/core/io/config_file.cpp +++ b/core/io/config_file.cpp @@ -127,6 +127,8 @@ Error ConfigFile::save(const String& p_path){ FileAccess *file = FileAccess::open(p_path,FileAccess::WRITE,&err); if (err) { + if (file) + memdelete(file); return err; } |