Skip to content

Commit

Permalink
Merge pull request godotengine#87782 from aaronfranke/4.2-fix-crash-m…
Browse files Browse the repository at this point in the history
…esh-root

[4.2] Fix crash when previewing a scene with a mesh as the root node
  • Loading branch information
akien-mga authored Feb 7, 2024
2 parents 991454b + 424a6a6 commit 474589e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion editor/import/scene_import_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,10 @@ void SceneImportSettings::_fill_scene(Node *p_node, TreeItem *p_parent_item) {
Ref<ImporterMesh> editor_mesh = src_mesh_node->get_mesh();
mesh_node->set_mesh(editor_mesh->get_mesh());
}

// Replace the original mesh node in the scene tree with the new one.
if (unlikely(p_node == scene)) {
scene = mesh_node;
}
p_node->replace_by(mesh_node);
memdelete(p_node);
p_node = mesh_node;
Expand Down

0 comments on commit 474589e

Please sign in to comment.