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
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user