From 89b5c84fd1d3993c61fbd5fa6e9b4afe1b2f048b 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 (cherry picked from commit 3f50dad460dc2239343e0eb9ba8fb63b8fd20b88) --- 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 31985481c..59fd6369e 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -3244,6 +3244,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); @@ -3889,7 +3892,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