mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 03:18:37 +08:00
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
Block a user