From 8ba1b94187a81d1d98b2f4fa84e1f66fc73385b7 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Mon, 6 Dec 2021 10:25:01 +0800 Subject: [PATCH] Fix EditorPlugin.remove_inspector_plugin() instance cleanup (cherry picked from commit da94b61d09cf4e787f445a07349edd51d71487c5) --- editor/editor_inspector.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 88e8f9120d3..36a21b4863d 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -1271,10 +1271,7 @@ void EditorInspector::remove_inspector_plugin(const Ref & for (int i = idx; i < inspector_plugin_count - 1; i++) { inspector_plugins[i] = inspector_plugins[i + 1]; } - - if (idx == inspector_plugin_count - 1) { - inspector_plugins[idx] = Ref(); - } + inspector_plugins[inspector_plugin_count - 1] = Ref(); inspector_plugin_count--; }