From eefd3114560afcfbaf826c806deabefb3643750c Mon Sep 17 00:00:00 2001 From: kit Date: Tue, 23 Apr 2024 15:07:34 -0400 Subject: [PATCH] Don't edit current when changing docks v2 --- editor/editor_dock_manager.cpp | 1 - editor/editor_inspector.cpp | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/editor/editor_dock_manager.cpp b/editor/editor_dock_manager.cpp index b6250671ee1..06dd33d8abd 100644 --- a/editor/editor_dock_manager.cpp +++ b/editor/editor_dock_manager.cpp @@ -147,7 +147,6 @@ void EditorDockManager::_update_layout() { if (!dock_context_popup->is_inside_tree() || EditorNode::get_singleton()->is_exiting()) { return; } - EditorNode::get_singleton()->edit_current(); dock_context_popup->docks_updated(); _update_docks_menu(); EditorNode::get_singleton()->save_editor_layout_delayed(); diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 50cc89c6183..d16eed98172 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -4019,14 +4019,16 @@ void EditorInspector::_notification(int p_what) { } break; case NOTIFICATION_PREDELETE: { - edit(nullptr); //just in case + if (EditorNode::get_singleton() && !EditorNode::get_singleton()->is_exiting()) { + // Don't need to clean up if exiting, and object may already be freed. + edit(nullptr); + } } break; case NOTIFICATION_EXIT_TREE: { if (!sub_inspector) { get_tree()->disconnect("node_removed", callable_mp(this, &EditorInspector::_node_removed)); } - edit(nullptr); } break; case NOTIFICATION_VISIBILITY_CHANGED: {