Skip to content

Commit 2532454

Browse files
committed
Merge pull request godotengine#91538 from kitbdev/fix-inspector-exit-crash
Fix EditorInspector crash when exiting
2 parents f9eb81e + 55afb5b commit 2532454

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

editor/editor_inspector.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4039,25 +4039,16 @@ void EditorInspector::_notification(int p_what) {
40394039
EditorFeatureProfileManager::get_singleton()->connect("current_feature_profile_changed", callable_mp(this, &EditorInspector::_feature_profile_changed));
40404040
set_process(is_visible_in_tree());
40414041
add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree")));
4042-
} break;
4043-
4044-
case NOTIFICATION_ENTER_TREE: {
40454042
if (!sub_inspector) {
40464043
get_tree()->connect("node_removed", callable_mp(this, &EditorInspector::_node_removed));
40474044
}
40484045
} break;
40494046

40504047
case NOTIFICATION_PREDELETE: {
4051-
if (EditorNode::get_singleton() && !EditorNode::get_singleton()->is_exiting()) {
4052-
// Don't need to clean up if exiting, and object may already be freed.
4053-
edit(nullptr);
4054-
}
4055-
} break;
4056-
4057-
case NOTIFICATION_EXIT_TREE: {
4058-
if (!sub_inspector) {
4048+
if (!sub_inspector && is_inside_tree()) {
40594049
get_tree()->disconnect("node_removed", callable_mp(this, &EditorInspector::_node_removed));
40604050
}
4051+
edit(nullptr);
40614052
} break;
40624053

40634054
case NOTIFICATION_VISIBILITY_CHANGED: {

0 commit comments

Comments
 (0)