浏览代码

Fix crash on exit when removing EditorInspectorPlugins

Will Nations 6 年之前
父节点
当前提交
27f9780cc6
共有 1 个文件被更改,包括 4 次插入0 次删除
  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--;
 }