You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
Close FileAccess before accessing it with DirAccess
This commit is contained in:
@@ -1153,6 +1153,8 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons
|
||||
uint32_t ver_format = f->get_32();
|
||||
|
||||
if (ver_format < FORMAT_VERSION_CAN_RENAME_DEPS) {
|
||||
fw.unref();
|
||||
|
||||
{
|
||||
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
|
||||
da->remove(p_path + ".depren");
|
||||
@@ -1295,6 +1297,8 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons
|
||||
return ERR_CANT_CREATE;
|
||||
}
|
||||
|
||||
fw.unref();
|
||||
|
||||
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
|
||||
da->remove(p_path);
|
||||
da->rename(p_path + ".depren", p_path);
|
||||
|
||||
Reference in New Issue
Block a user