Commit 727157ba authored by Jan Möbius's avatar Jan Möbius
Browse files

Don't crash in garbage collection, if certain status flags are not available



git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@658 fdac6126-5c0c-442c-9429-916003d36597
parent 7824deb5
......@@ -61,6 +61,7 @@ void ArrayKernel::garbage_collection(std_API_Container_VHandlePointer& vh_to_upd
std_API_Container_FHandlePointer& fh_to_update,
bool _v, bool _e, bool _f)
{
int i, i0, i1, nV(n_vertices()), nE(n_edges()), nH(2*n_edges()), nF(n_faces());
std::vector<VertexHandle> vh_map;
......@@ -78,7 +79,7 @@ void ArrayKernel::garbage_collection(std_API_Container_VHandlePointer& vh_to_upd
for (i=0; i<nF; ++i) fh_map.push_back(FaceHandle(i));
// remove deleted vertices
if (_v && n_vertices() > 0)
if (_v && n_vertices() > 0 && this->has_vertex_status() )
{
i0=0; i1=nV-1;
......@@ -101,7 +102,7 @@ void ArrayKernel::garbage_collection(std_API_Container_VHandlePointer& vh_to_upd
// remove deleted edges
if (_e && n_edges() > 0)
if (_e && n_edges() > 0 && this->has_edge_status() )
{
i0=0; i1=nE-1;
......@@ -128,7 +129,7 @@ void ArrayKernel::garbage_collection(std_API_Container_VHandlePointer& vh_to_upd
// remove deleted faces
if (_f && n_faces() > 0)
if (_f && n_faces() > 0 && this->has_face_status() )
{
i0=0; i1=nF-1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment