summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2022-04-22 18:15:31 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2022-04-22 18:15:31 +0800
commitcaf8e5e3396f7210c11757874e48af641f924c17 (patch)
tree6137d82912243dd4a1122c06cbc04f06e8f40e16 /scene/resources
parentf4b0c7a1ea8d86c1dfd96478ca12ad1360903d9d (diff)
Close FileAccess before accessing it with DirAccess
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/resource_format_text.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp
index 4b0456681b..b18456d464 100644
--- a/scene/resources/resource_format_text.cpp
+++ b/scene/resources/resource_format_text.cpp
@@ -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);