summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2021-12-06 10:25:01 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2021-12-06 10:25:01 +0800
commitda94b61d09cf4e787f445a07349edd51d71487c5 (patch)
tree8dd1275c4da17080f2edd0692b11f53635aaa22a /editor
parentb8ebe3b0bfabab4790f94e7cc9bf2869746a0454 (diff)
Fix EditorPlugin.remove_inspector_plugin() instance cleanup
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_inspector.cpp5
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--;
}