Selaa lähdekoodia

Fixed issue where descriptor is left hanging, which causes file locked on Windows, closes #26342

Juan Linietsky 6 vuotta sitten
vanhempi
commit
f1e3bb0a15
1 muutettua tiedostoa jossa 8 lisäystä ja 4 poistoa
  1. 8 4
      editor/editor_file_system.cpp

+ 8 - 4
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;