summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorWill Nations <willnationsdev@gmail.com>2019-03-05 17:03:38 -0600
committerRĂ©mi Verschelde <rverschelde@gmail.com>2019-03-06 00:14:42 +0100
commit27f9780cc621bbeeeeffe0d113cd643922e1d38d (patch)
tree8c33dcbd95a8917a24a6f24289c973202983ae9f /editor
parent4a8f219660bfeb58a781cb012584455314055edd (diff)
Fix crash on exit when removing EditorInspectorPlugins
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_inspector.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index e8ee5069a5..1a08977f9c 100644
--- a/editor/editor_inspector.cpp
+++ b/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--;
}