You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-13 13:31:48 +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);
|
||||
|
||||
@@ -898,6 +898,8 @@ Error ResourceLoaderText::rename_dependencies(Ref<FileAccess> p_f, const String
|
||||
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