Force inspector to clean up on delete, fixes crash.

This commit is contained in:
Juan Linietsky 2019-03-07 12:39:53 -03:00
parent 6cb841edcb
commit b376273f1b

View file

@ -1236,6 +1236,7 @@ EditorInspectorSection::EditorInspectorSection() {
} }
EditorInspectorSection::~EditorInspectorSection() { EditorInspectorSection::~EditorInspectorSection() {
if (!vbox_added) { if (!vbox_added) {
memdelete(vbox); memdelete(vbox);
} }
@ -2140,6 +2141,9 @@ void EditorInspector::_notification(int p_what) {
get_tree()->connect("node_removed", this, "_node_removed"); 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 (p_what == NOTIFICATION_EXIT_TREE) {
if (!sub_inspector) { if (!sub_inspector) {