From b376273f1b30b1187731b318c0f6eb0447acd289 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 7 Mar 2019 12:39:53 -0300 Subject: [PATCH] Force inspector to clean up on delete, fixes crash. --- editor/editor_inspector.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index a0b4a67d949..60fa5ff16f2 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -1236,6 +1236,7 @@ EditorInspectorSection::EditorInspectorSection() { } EditorInspectorSection::~EditorInspectorSection() { + if (!vbox_added) { memdelete(vbox); } @@ -2140,6 +2141,9 @@ void EditorInspector::_notification(int p_what) { get_tree()->connect("node_removed", this, "_node_removed"); } } + if (p_what == NOTIFICATION_PREDELETE) { + edit(NULL); //just in case + } if (p_what == NOTIFICATION_EXIT_TREE) { if (!sub_inspector) {