From da94b61d09cf4e787f445a07349edd51d71487c5 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 --- 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 e1fae470573..a6cd07dab33 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -2194,10 +2194,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--; }