From 27f9780cc621bbeeeeffe0d113cd643922e1d38d Mon Sep 17 00:00:00 2001 From: Will Nations Date: Tue, 5 Mar 2019 17:03:38 -0600 Subject: [PATCH] Fix crash on exit when removing EditorInspectorPlugins --- editor/editor_inspector.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index e8ee5069a53..1a08977f9c5 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -1294,6 +1294,10 @@ void EditorInspector::remove_inspector_plugin(const Ref & 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(); + inspector_plugin_count--; }