diff --git a/src/OpenVolumeMesh/Core/ResourceManager.cc b/src/OpenVolumeMesh/Core/ResourceManager.cc index 32af33729ce06534abb9c2cd1830bd79ff27b84c..cca64c97f637f204784a07d352b89432b95126e2 100644 --- a/src/OpenVolumeMesh/Core/ResourceManager.cc +++ b/src/OpenVolumeMesh/Core/ResourceManager.cc @@ -122,8 +122,8 @@ void ResourceManager::resize_fprops(unsigned int _nf) { void ResourceManager::resize_cprops(unsigned int _nc) { - for(std::vector::iterator it = mesh_props_.begin(); - it != mesh_props_.end(); ++it) { + for(std::vector::iterator it = cell_props_.begin(); + it != cell_props_.end(); ++it) { (*it)->resize(_nc); } } @@ -174,9 +174,10 @@ void ResourceManager::released_property(VertexPropHandle _handle) { delete (*(vertex_props_.begin() + _handle.idx())); std::vector::iterator it = vertex_props_.erase(vertex_props_.begin() + _handle.idx()); - VertexPropHandle decrHandle(_handle.idx() - 1); + VertexPropHandle decrHandle(_handle.idx()); for(; it < vertex_props_.end(); ++it) { (*it)->set_handle(decrHandle); + decrHandle.idx(decrHandle.idx()+1); } } @@ -184,9 +185,10 @@ void ResourceManager::released_property(EdgePropHandle _handle) { delete (*(edge_props_.begin() + _handle.idx())); std::vector::iterator it = edge_props_.erase(edge_props_.begin() + _handle.idx()); - EdgePropHandle decrHandle(_handle.idx() - 1); + EdgePropHandle decrHandle(_handle.idx()); for(; it < edge_props_.end(); ++it) { (*it)->set_handle(decrHandle); + decrHandle.idx(decrHandle.idx()+1); } } @@ -194,9 +196,10 @@ void ResourceManager::released_property(HalfEdgePropHandle _handle) { delete (*(halfedge_props_.begin() + _handle.idx())); std::vector::iterator it = halfedge_props_.erase(halfedge_props_.begin() + _handle.idx()); - HalfEdgePropHandle decrHandle(_handle.idx() - 1); + HalfEdgePropHandle decrHandle(_handle.idx()); for(; it < halfedge_props_.end(); ++it) { (*it)->set_handle(decrHandle); + decrHandle.idx(decrHandle.idx()+1); } } @@ -204,9 +207,10 @@ void ResourceManager::released_property(FacePropHandle _handle) { delete (*(face_props_.begin() + _handle.idx())); std::vector::iterator it = face_props_.erase(face_props_.begin() + _handle.idx()); - FacePropHandle decrHandle(_handle.idx() - 1); + FacePropHandle decrHandle(_handle.idx()); for(; it < face_props_.end(); ++it) { (*it)->set_handle(decrHandle); + decrHandle.idx(decrHandle.idx()+1); } } @@ -214,9 +218,10 @@ void ResourceManager::released_property(HalfFacePropHandle _handle) { delete (*(halfface_props_.begin() + _handle.idx())); std::vector::iterator it = halfface_props_.erase(halfface_props_.begin() + _handle.idx()); - HalfFacePropHandle decrHandle(_handle.idx() - 1); + HalfFacePropHandle decrHandle(_handle.idx()); for(; it < halfface_props_.end(); ++it) { (*it)->set_handle(decrHandle); + decrHandle.idx(decrHandle.idx()+1); } } @@ -224,9 +229,10 @@ void ResourceManager::released_property(CellPropHandle _handle) { delete (*(cell_props_.begin() + _handle.idx())); std::vector::iterator it = cell_props_.erase(cell_props_.begin() + _handle.idx()); - CellPropHandle decrHandle(_handle.idx() - 1); + CellPropHandle decrHandle(_handle.idx()); for(; it < cell_props_.end(); ++it) { (*it)->set_handle(decrHandle); + decrHandle.idx(decrHandle.idx()+1); } } @@ -234,9 +240,10 @@ void ResourceManager::released_property(MeshPropHandle _handle) { delete (*(mesh_props_.begin() + _handle.idx())); std::vector::iterator it = mesh_props_.erase(mesh_props_.begin() + _handle.idx()); - MeshPropHandle decrHandle(_handle.idx() - 1); + MeshPropHandle decrHandle(_handle.idx()); for(; it < mesh_props_.end(); ++it) { (*it)->set_handle(decrHandle); + decrHandle.idx(decrHandle.idx()+1); } }