Fix memory leak in ResourceFormatSaverBinary::save
This commit is contained in:
parent
208dd5b4a6
commit
b244ab4acc
1 changed files with 3 additions and 0 deletions
|
@ -1786,6 +1786,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p
|
|||
|
||||
if (f->get_error() != OK && f->get_error() != ERR_FILE_EOF) {
|
||||
f->close();
|
||||
memdelete(f);
|
||||
return ERR_CANT_CREATE;
|
||||
}
|
||||
|
||||
|
@ -1938,10 +1939,12 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p
|
|||
|
||||
if (f->get_error() != OK && f->get_error() != ERR_FILE_EOF) {
|
||||
f->close();
|
||||
memdelete(f);
|
||||
return ERR_CANT_CREATE;
|
||||
}
|
||||
|
||||
f->close();
|
||||
memdelete(f);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue