diff --git a/BGL/include/CGAL/boost/graph/copy_face_graph.h b/BGL/include/CGAL/boost/graph/copy_face_graph.h index 2517d5ee982..9fb8a4a41ae 100644 --- a/BGL/include/CGAL/boost/graph/copy_face_graph.h +++ b/BGL/include/CGAL/boost/graph/copy_face_graph.h @@ -74,6 +74,10 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm, sm_halfedge_descriptor sm_h = halfedge(sm_e, sm), sm_h_opp = opposite(sm_h, sm); tm_halfedge_descriptor tm_h = halfedge(tm_e, tm), tm_h_opp = opposite(tm_h, tm); + // set next pointers to null_halfedge() (in case previous garbage is present) + set_next( tm_h, boost::graph_traits::null_halfedge(), tm ); + set_next( tm_h_opp, boost::graph_traits::null_halfedge(), tm ); + put(hmap, sm_h, tm_h); put(hmap, sm_h_opp, tm_h_opp); *h2h++=std::make_pair(sm_h, tm_h);