From 7a9b33fcc5a9263ef8135465faa6bfe5681564cc Mon Sep 17 00:00:00 2001 From: giorgiomarcias Date: Fri, 14 Mar 2014 14:56:17 +0000 Subject: [PATCH] Corrected a bug which could happen because of memory not released. --- vcg/complex/algorithms/polygon_polychord_collapse.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vcg/complex/algorithms/polygon_polychord_collapse.h b/vcg/complex/algorithms/polygon_polychord_collapse.h index a9ed041f..0fbf999b 100644 --- a/vcg/complex/algorithms/polygon_polychord_collapse.h +++ b/vcg/complex/algorithms/polygon_polychord_collapse.h @@ -959,6 +959,11 @@ public: FaceIterator firstAddedFaceIt = vcg::tri::Allocator::AddFaces(mesh, FN, facesToUpdate); // add vertices to the mesh VertexIterator firstAddedVertexIt = vcg::tri::Allocator::AddVertices(mesh, VN, verticesToUpdate); + + // delete the added starting position's face and vertex pointers + facesToUpdate.pop_back(); + verticesToUpdate.pop_back(); + // allocate and initialize 4 vertices and ffAdj for each new face for (FaceIterator fIt = firstAddedFaceIt; fIt != mesh.face.end(); fIt++) { fIt->Alloc(4);