From f5a3c1ccdeece4fa7832e7998f21448e2d9aafa7 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 10 Jan 2016 09:59:14 -0300 Subject: [PATCH] make sure file is closed if something fails --- core/io/config_file.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/io/config_file.cpp b/core/io/config_file.cpp index d79a3d12881..f2d6f786645 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; }