destructors implemented

per mesh normals

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@159 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/1/head
cgmelt 2008-09-22 08:16:37 +00:00
parent 12d407c974
commit 7d665832f6
1 changed files with 31 additions and 3 deletions

View File

@ -93,7 +93,18 @@ struct Face
//! \brief Destructor //! \brief Destructor
~Face() ~Face()
{ {
// empty if(m_pVertices) {
delete m_pVertices;
m_pVertices = NULL;
}
if(m_pNormals) {
delete m_pNormals;
m_pNormals = NULL;
}
if(m_pTexturCoords) {
delete m_pTexturCoords;
m_pTexturCoords = NULL;
}
} }
}; };
@ -181,11 +192,13 @@ struct Mesh
/// Material index. /// Material index.
unsigned int m_uiMaterialIndex; unsigned int m_uiMaterialIndex;
bool m_hasNormals;
/// Constructor /// Constructor
Mesh() : Mesh() :
m_pMaterial(NULL), m_pMaterial(NULL),
m_uiNumIndices(0), m_uiNumIndices(0),
m_uiMaterialIndex(0) m_uiMaterialIndex(0),
m_hasNormals(false)
{ {
memset(m_uiUVCoordinates, 0, sizeof( unsigned int ) * AI_MAX_NUMBER_OF_TEXTURECOORDS); memset(m_uiUVCoordinates, 0, sizeof( unsigned int ) * AI_MAX_NUMBER_OF_TEXTURECOORDS);
} }
@ -193,7 +206,12 @@ struct Mesh
/// Destructor /// Destructor
~Mesh() ~Mesh()
{ {
// empty for (std::vector<Face*>::iterator it = m_Faces.begin();
it != m_Faces.end(); ++it)
{
delete *it;
}
} }
}; };
@ -269,7 +287,17 @@ struct Model
{ {
delete *it; delete *it;
} }
m_Meshes.clear(); m_Meshes.clear();
for(GroupMapIt it = m_Groups.begin();
it != m_Groups.end(); ++it)
{
delete it->second;
}
m_Groups.clear();
} }
}; };