Fix EditorPlugin.remove_inspector_plugin() instance cleanup

(cherry picked from commit da94b61d09)
This commit is contained in:
Haoyu Qiu 2021-12-06 10:25:01 +08:00 committed by Rémi Verschelde
parent 8c59dbda33
commit 8ba1b94187
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -1271,10 +1271,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--;
}