added Trimesh destructor to purge unremoved PerVertex[PerFace]Attribute

This commit is contained in:
ganovelli 2008-05-16 10:07:36 +00:00
parent 69a35e8912
commit 1f929ed8f4
1 changed files with 13 additions and 0 deletions

View File

@ -24,6 +24,9 @@
History
$Log: not supported by cvs2svn $
Revision 1.33 2008/05/15 16:32:27 ganovelli
PerVertexAttribute and PerFaceAttribute added to Trimesh
Revision 1.32 2008/04/15 10:34:07 cignoni
added HasPerVertexTexCoord ( mesh )
@ -247,6 +250,16 @@ public:
imark = 0;
}
/// destructor
~TriMesh()
{
std::set< HandlesWrapper>::iterator i;
for( i = vert_attr.begin(); i != vert_attr.end(); ++i)
delete ((SimpleTempDataBase<VertContainer>*)(*i)._handle);
for( i = face_attr.begin(); i != face_attr.end(); ++i)
delete ((SimpleTempDataBase<FaceContainer>*)(*i)._handle);
}
inline int MemUsed() const
{
return sizeof(MeshType)+sizeof(VertexType)*vert.size()+sizeof(FaceType)*face.size();