From fd9d5748730bd3827e8c112680f25c18b73835b1 Mon Sep 17 00:00:00 2001 From: Xtarsia <69606701+Xtarsia@users.noreply.github.com> Date: Sun, 13 Oct 2024 22:11:31 +0100 Subject: [PATCH] fix crash after freeing cell mmi --- src/terrain_3d_instancer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/terrain_3d_instancer.cpp b/src/terrain_3d_instancer.cpp index d6ac6d102..4b705f94d 100644 --- a/src/terrain_3d_instancer.cpp +++ b/src/terrain_3d_instancer.cpp @@ -573,6 +573,7 @@ void Terrain3DInstancer::remove_instances(const Vector3 &p_global_position, cons MultiMeshInstance3D *mmi = cast_to(mesh_mmis[cell]); remove_from_tree(mmi); memdelete_safely(mmi); + mesh_mmis.erase(cell); } cells_dict.erase(cell); }