Fixed minor memory leak.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5651 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-07-05 23:03:19 +00:00
parent b84043f819
commit 2bb985313d
2 changed files with 14 additions and 1 deletions

View File

@ -41,6 +41,18 @@ MaterialManager::MaterialManager()
// be moved into a separate function. // be moved into a separate function.
} }
//-----------------------------------------------------------------------------
/** Frees all allocated data structures.
*/
MaterialManager::~MaterialManager()
{
for(unsigned int i=0; i<m_materials.size(); i++)
{
delete m_materials[i];
}
m_materials.clear();
} // ~MaterialManager
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void MaterialManager::setAllFlatMaterialFlags(scene::IMeshBuffer *mb) const void MaterialManager::setAllFlatMaterialFlags(scene::IMeshBuffer *mb) const

View File

@ -41,7 +41,8 @@ private:
std::vector<Material*> m_materials; std::vector<Material*> m_materials;
public: public:
MaterialManager(); MaterialManager();
~MaterialManager();
void loadMaterial (); void loadMaterial ();
void reInit (); void reInit ();
void setAllMaterialFlags(video::ITexture* t, void setAllMaterialFlags(video::ITexture* t,