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 3be071f8c6
commit dcb5d7a14f
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

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