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
This commit is contained in:
Noisyfox 2025-03-01 13:02:47 +08:00 committed by GitHub
parent 2547a23135
commit af61ee38f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -179,7 +179,7 @@ std::vector<Vec3d> MeshClipper::point_per_contour() const {
return out; return out;
} }
assert(m_result); assert(m_result);
for (auto isl : m_result->cut_islands) { for (const auto& isl : m_result->cut_islands) {
assert(isl.expoly.contour.size() > 2); assert(isl.expoly.contour.size() > 2);
// Now return a point lying inside the contour but not in a hole. // 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 // We do this by taking a point lying close to the edge, repeating