Explorar o código

Fix crash on exit when removing EditorInspectorPlugins

Will Nations %!s(int64=6) %!d(string=hai) anos
pai
achega
27f9780cc6
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      editor/editor_inspector.cpp

+ 4 - 0
editor/editor_inspector.cpp

@@ -1294,6 +1294,10 @@ 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_plugin_count--;
 }