Merge pull request #55658 from timothyqiu/remove-inspector-plugin

Fix `EditorPlugin.remove_inspector_plugin()` instance cleanup
This commit is contained in:
Rémi Verschelde 2021-12-06 08:37:15 +01:00 committed by GitHub
commit 0c92edddc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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--;
}