summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <juan@godotengine.org>2019-03-07 12:39:53 -0300
committerJuan Linietsky <juan@godotengine.org>2019-03-07 12:39:53 -0300
commitb376273f1b30b1187731b318c0f6eb0447acd289 (patch)
tree939337f4982deef582e102d5ff6d9502c770e52d
parent6cb841edcb1295a4877ed27330f0ba4c049ddafa (diff)
Force inspector to clean up on delete, fixes crash.
-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 a0b4a67d94..60fa5ff16f 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) {