make sure file is closed if something fails
This commit is contained in:
parent
3a3ce982b0
commit
f5a3c1ccde
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue