You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-13 13:31:48 +00:00
Fix memory leak in ResourceFormatSaverBinary::save
(cherry picked from commit b244ab4acc)
This commit is contained in:
@@ -1801,6 +1801,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;
|
||||
}
|
||||
|
||||
@@ -1953,10 +1954,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user