Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Prevent recursive update of scan actions

kobewi81af5af1fd34
diff --git a/editor/file_system/editor_file_system.cpp b/editor/file_system/editor_file_system.cpp
index f4045a9769b..63360abf135 100644
--- a/editor/file_system/editor_file_system.cpp
+++ b/editor/file_system/editor_file_system.cpp
@@ -850,6 +850,11 @@ bool EditorFileSystem::_scan_import_support(const Vector<String> &reimports) {
}
bool EditorFileSystem::_update_scan_actions() {
+ if (updating_scan_actions) {
+ return false;
+ }
+ updating_scan_actions = true;
+
sources_changed.clear();
// We need to update the script global class names before the reimports to be sure that
@@ -1070,6 +1075,7 @@ bool EditorFileSystem::_update_scan_actions() {
}
scan_actions.clear();
+ updating_scan_actions = false;
return fs_changed;
}
diff --git a/editor/file_system/editor_file_system.h b/editor/file_system/editor_file_system.h
index cf3effc992b..45c039709b8 100644
--- a/editor/file_system/editor_file_system.h
+++ b/editor/file_system/editor_file_system.h
@@ -268,6 +268,7 @@ class EditorFileSystem : public Node {
List<String> sources_changed;
List<ItemAction> scan_actions;
+ bool updating_scan_actions = false;
bool _update_scan_actions();