make sure file is closed if something fails

This commit is contained in:
Juan Linietsky 2016-01-10 09:59:14 -03:00
parent 3a3ce982b0
commit f5a3c1ccde

View file

@ -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;
}