diff options
author | Juan Linietsky <juan@godotengine.org> | 2019-02-27 09:36:23 -0300 |
---|---|---|
committer | Juan Linietsky <juan@godotengine.org> | 2019-02-27 09:37:19 -0300 |
commit | f1e3bb0a159636c6c42701da9ed843d859fcbf2a (patch) | |
tree | 11f793f1129cc9e8d5a2ab2656b88943996ee2cb /editor | |
parent | f0f277faf1c1506443d549aacdc3b52ca9a55d61 (diff) |
Fixed issue where descriptor is left hanging, which causes file locked on Windows, closes #26342
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_file_system.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index a662c50c04..3d9d5e26be 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -342,10 +342,7 @@ bool EditorFileSystem::_test_for_reimport(const String &p_path, bool p_only_impo if (!reimport_on_missing_imported_files && p_only_imported_files) return false; - Error err; - FileAccess *f = FileAccess::open(p_path + ".import", FileAccess::READ, &err); - - if (!f) { //no import file, do reimport + if (!FileAccess::exists(p_path + ".import")) { return true; } @@ -354,6 +351,13 @@ bool EditorFileSystem::_test_for_reimport(const String &p_path, bool p_only_impo return true; } + Error err; + FileAccess *f = FileAccess::open(p_path + ".import", FileAccess::READ, &err); + + if (!f) { //no import file, do reimport + return true; + } + VariantParser::StreamFile stream; stream.f = f; |