Merge branch 'Minkowski_sum_3-fix_leak-pmoeller' with approval of the RM

This commit is contained in:
Philipp Möller 2013-02-16 16:18:36 +01:00
commit 01ac6dd2ef
4 changed files with 26 additions and 0 deletions

View File

@ -132,6 +132,11 @@ David A. Wheeler's 'SLOCCount'</a>, restricted to the <code>include/CGAL/</code>
</li>
</ul>
<h3>3D Minkowski Sum of Polyhedra</h3>
<ul>
<li> Fix a memory leak.
</ul>
<h3>3D Fast Intersection and Distance Computation</h3>
<ul>
<li> Update requirements of the concepts <code>AABBTraits</code> and <code>AABBGeomTraits</code> to match the implementation of the package.

View File

@ -220,6 +220,16 @@ bipartite_nary_union_sorted_combined(Nef_polyhedron& N0,
Ntmp.delegate(Convertor, true);
CGAL_assertion(Ntmp.is_valid());
nary_union.add_polyhedron(Ntmp);
delete GcG.sphere_map();
}
// clean up the spherical_mapS
for(GM_iterator it = GM0.begin(); it != GM0.end(); ++it) {
delete it->first.sphere_map();
}
for(GM_iterator it = GM1.begin(); it != GM1.end(); ++it) {
delete it->first.sphere_map();
}
return nary_union.get_union();

View File

@ -40,6 +40,7 @@ void test_convex_parts(Nef_polyhedron_3& N)
CGAL_assertion(tmp1.is_valid());
CGAL_assertion(tmp1.closure().symmetric_difference(tmp0).is_empty());
delete G.sphere_map();
}
}
@ -60,6 +61,9 @@ void test_convex_parts(Nef_polyhedron_3& N)
CGAL_assertion(tmp.vertices_begin()->mark());
CGAL_assertion(!tmp.volumes_begin()->mark());
CGAL_assertion(tmp.vertices_begin()->point() == vi->point());
delete G.sphere_map();
std::cerr << "single vertex " << std::endl;
}
}
@ -85,6 +89,8 @@ void test_convex_parts(Nef_polyhedron_3& N)
eci->source()->point() ||
tmp.vertices_begin()->point() ==
eci->twin()->source()->point());
delete G.sphere_map();
std::cerr << "single edge " << std::endl;
}
@ -106,6 +112,8 @@ void test_convex_parts(Nef_polyhedron_3& N)
CGAL_assertion(!tmp.volumes_begin()->mark());
CGAL_assertion(tmp.halffacets_begin()->plane() == fci->plane() ||
tmp.halffacets_begin()->plane() == fci->twin()->plane());
delete G.sphere_map();
std::cerr << "single facet " << std::endl;
}
}

View File

@ -125,6 +125,9 @@ handles |SVertex_handle|, |SHalfedge_handle|, or
|SHalfloop_handle|.}*/
protected:
// don't change this into a shared_ptr even if it seems sensible.
// minkowski_sum_3 already has a fix in place that deletes the
// object psm_ points to.
Map* psm_;
public: