From caf8e5e3396f7210c11757874e48af641f924c17 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Fri, 22 Apr 2022 18:15:31 +0800 Subject: Close FileAccess before accessing it with DirAccess --- scene/resources/resource_format_text.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scene/resources') 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 p_f, const String return ERR_CANT_CREATE; } + fw.unref(); + Ref da = DirAccess::create(DirAccess::ACCESS_RESOURCES); da->remove(p_path); da->rename(p_path + ".depren", p_path); -- cgit v1.2.3