From af61ee38f34369f5c202c4ed7cc9a4247f4ba6ef Mon Sep 17 00:00:00 2001 From: Noisyfox Date: Sat, 1 Mar 2025 13:02:47 +0800 Subject: [PATCH] Cut: Fix crash caused by unexpected copy of the cut island (#8598) Cut: Fix crash caused by unexpected copy of the cut island (#8579) which frees the OpenGL VBOs and IBOs when loop ends and cause the crash --- src/slic3r/GUI/MeshUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slic3r/GUI/MeshUtils.cpp b/src/slic3r/GUI/MeshUtils.cpp index 85e34c503e..26f3e1ed6b 100644 --- a/src/slic3r/GUI/MeshUtils.cpp +++ b/src/slic3r/GUI/MeshUtils.cpp @@ -179,7 +179,7 @@ std::vector MeshClipper::point_per_contour() const { return out; } assert(m_result); - for (auto isl : m_result->cut_islands) { + for (const auto& isl : m_result->cut_islands) { assert(isl.expoly.contour.size() > 2); // Now return a point lying inside the contour but not in a hole. // We do this by taking a point lying close to the edge, repeating