mirror of https://github.com/godotengine/godot
make sure file is closed if something fails
This commit is contained in:
parent
3a3ce982b0
commit
f5a3c1ccde
|
|
@ -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 New Issue