Browse Source

Force inspector to clean up on delete, fixes crash.

Juan Linietsky 6 years ago
parent
commit
b376273f1b
1 changed files with 4 additions and 0 deletions
  1. 4 0
      editor/editor_inspector.cpp

+ 4 - 0
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) {