From 3f50dad460dc2239343e0eb9ba8fb63b8fd20b88 Mon Sep 17 00:00:00 2001 From: kobewi Date: Thu, 5 May 2022 14:27:29 +0200 Subject: [PATCH] Cache script icons in editor --- editor/editor_node.cpp | 14 ++++++++++++-- editor/editor_node.h | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 7577927c944..b6f1a89e2f0 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -3405,6 +3405,9 @@ void EditorNode::_remove_edited_scene(bool p_change_tab) { } void EditorNode::_remove_scene(int index, bool p_change_tab) { + // Clear icon cache in case some scripts are no longer needed. + script_icon_cache.clear(); + if (editor_data.get_edited_scene() == index) { // Scene to remove is current scene. _remove_edited_scene(p_change_tab); @@ -4055,7 +4058,7 @@ void EditorNode::_pick_main_scene_custom_action(const String &p_custom_action_na } } -Ref EditorNode::get_object_icon(const Object *p_object, const String &p_fallback) const { +Ref EditorNode::get_object_icon(const Object *p_object, const String &p_fallback) { ERR_FAIL_COND_V(!p_object || !gui_base, nullptr); Ref