diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2021-12-06 10:25:01 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2021-12-06 10:25:01 +0800 |
commit | da94b61d09cf4e787f445a07349edd51d71487c5 (patch) | |
tree | 8dd1275c4da17080f2edd0692b11f53635aaa22a /editor | |
parent | b8ebe3b0bfabab4790f94e7cc9bf2869746a0454 (diff) |
Fix EditorPlugin.remove_inspector_plugin() instance cleanup
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_inspector.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index e1fae47057..a6cd07dab3 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -2194,10 +2194,7 @@ void EditorInspector::remove_inspector_plugin(const Ref<EditorInspectorPlugin> & 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<EditorInspectorPlugin>(); - } + inspector_plugins[inspector_plugin_count - 1] = Ref<EditorInspectorPlugin>(); inspector_plugin_count--; } |