From 10b7d20418bc73b6901da15c9cd7f3b67ff46c2b Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 13 Apr 2022 23:10:42 +0200 Subject: [PATCH] Fix crash. --- .../editor/utilities/mdr_ed_mesh_decompose.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/mesh_data_resource/editor/utilities/mdr_ed_mesh_decompose.cpp b/modules/mesh_data_resource/editor/utilities/mdr_ed_mesh_decompose.cpp index f7cab512f..caca33147 100644 --- a/modules/mesh_data_resource/editor/utilities/mdr_ed_mesh_decompose.cpp +++ b/modules/mesh_data_resource/editor/utilities/mdr_ed_mesh_decompose.cpp @@ -111,7 +111,7 @@ MDREDMeshDecompose::HandleVertexMapResult MDREDMeshDecompose::get_handle_edge_to bool found = false; for (int ii = 0; ii < etm.size(); ++ii) { - if (etm[ii] == ei1) { + if (r[ii] == ei1) { found = true; break; } @@ -134,7 +134,7 @@ MDREDMeshDecompose::HandleVertexMapResult MDREDMeshDecompose::get_handle_edge_to PoolIntArray::Read r = indices.read(); - for (int i = 0; i < keys.size(); ++i) { + for (int i = 0; i < indices.size(); ++i) { int indx = r[i]; int ei0 = key; int ei1 = indx; @@ -149,7 +149,7 @@ MDREDMeshDecompose::HandleVertexMapResult MDREDMeshDecompose::get_handle_edge_to PoolIntArray vm0 = vert_to_optimized_vert_map[ei0]; PoolIntArray vm1 = vert_to_optimized_vert_map[ei1]; - PoolIntArray vm = PoolIntArray(); + PoolIntArray vm; vm.append_array(vm0); PoolIntArray::Read vm1r = vm1.read(); @@ -179,6 +179,8 @@ MDREDMeshDecompose::HandleVertexMapResult MDREDMeshDecompose::get_handle_edge_to ret.handle_to_vertex_map.push_back(vm); } + + r.release(); } return ret;