From 8a82d3e9a777ce956007707089c12d0b71aace88 Mon Sep 17 00:00:00 2001 From: Hilderin <81109165+Hilderin@users.noreply.github.com> Date: Fri, 14 Jun 2024 09:00:42 -0400 Subject: [PATCH] Fix ProgressDialog crash when importing TTF font --- editor/editor_file_system.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index cdad1f0fabe..a1e392cd7dd 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -1718,6 +1718,7 @@ void EditorFileSystem::update_file(const String &p_file) { } void EditorFileSystem::update_files(const Vector &p_script_paths) { + bool updated = false; for (const String &file : p_script_paths) { ERR_CONTINUE(file.is_empty()); EditorFileSystemDirectory *fs = nullptr; @@ -1747,6 +1748,7 @@ void EditorFileSystem::update_files(const Vector &p_script_paths) { memdelete(fs->files[cpos]); fs->files.remove_at(cpos); + updated = true; } } else { String type = ResourceLoader::get_resource_type(file); @@ -1814,12 +1816,15 @@ void EditorFileSystem::update_files(const Vector &p_script_paths) { if (fs->files[cpos]->type == SNAME("PackedScene")) { _queue_update_scene_groups(file); } + updated = true; } } - _update_pending_script_classes(); - _update_pending_scene_groups(); - call_deferred(SNAME("emit_signal"), "filesystem_changed"); //update later + if (updated) { + _update_pending_script_classes(); + _update_pending_scene_groups(); + call_deferred(SNAME("emit_signal"), "filesystem_changed"); //update later + } } HashSet EditorFileSystem::get_valid_extensions() const {