Merge pull request #91538 from kitbdev/fix-inspector-exit-crash

Fix EditorInspector crash when exiting
This commit is contained in:
Rémi Verschelde 2024-05-07 16:49:46 +02:00
commit 25324545f2
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 2 additions and 11 deletions

View File

@ -4039,25 +4039,16 @@ void EditorInspector::_notification(int p_what) {
EditorFeatureProfileManager::get_singleton()->connect("current_feature_profile_changed", callable_mp(this, &EditorInspector::_feature_profile_changed));
set_process(is_visible_in_tree());
add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree")));
} break;
case NOTIFICATION_ENTER_TREE: {
if (!sub_inspector) {
get_tree()->connect("node_removed", callable_mp(this, &EditorInspector::_node_removed));
}
} break;
case NOTIFICATION_PREDELETE: {
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) {
if (!sub_inspector && is_inside_tree()) {
get_tree()->disconnect("node_removed", callable_mp(this, &EditorInspector::_node_removed));
}
edit(nullptr);
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {