diff options
author | Hilderin <81109165+Hilderin@users.noreply.github.com> | 2024-06-14 09:00:42 -0400 |
---|---|---|
committer | Hilderin <81109165+Hilderin@users.noreply.github.com> | 2024-06-14 09:00:42 -0400 |
commit | 8a82d3e9a777ce956007707089c12d0b71aace88 (patch) | |
tree | de7f06fb08f6120bd45da14438689c354da6d6ed /editor | |
parent | 680e489189796af2c34f06df49e19b17dec5c6fc (diff) | |
download | redot-engine-8a82d3e9a777ce956007707089c12d0b71aace88.tar.gz |
Fix ProgressDialog crash when importing TTF font
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_file_system.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index cdad1f0fab..a1e392cd7d 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<String> &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<String> &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<String> &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<String> EditorFileSystem::get_valid_extensions() const { |