Fixed memory leak (check_manager and therefore all check structures
were not freed). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6746 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
7c36638e63
commit
03ff921883
@ -55,6 +55,16 @@ CheckManager::CheckManager(const XMLNode &node, Track *track)
|
||||
} // CheckManager
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
CheckManager::~CheckManager()
|
||||
{
|
||||
for(unsigned int i=0; i<m_all_checks.size(); i++)
|
||||
{
|
||||
delete m_all_checks[i];
|
||||
}
|
||||
} // ~CheckManager
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
/** Resets all checks. */
|
||||
void CheckManager::reset(const Track &track)
|
||||
{
|
||||
|
@ -36,6 +36,7 @@ private:
|
||||
std::vector<CheckStructure*> m_all_checks;
|
||||
public:
|
||||
CheckManager(const XMLNode &node, Track *track);
|
||||
~CheckManager();
|
||||
void update(float dt);
|
||||
void reset(const Track &track);
|
||||
/** Returns the nth. check structure. */
|
||||
|
@ -146,6 +146,12 @@ void Track::cleanup()
|
||||
m_animation_manager = NULL;
|
||||
}
|
||||
|
||||
if(m_check_manager)
|
||||
{
|
||||
delete m_check_manager;
|
||||
m_check_manager=NULL;
|
||||
}
|
||||
|
||||
delete m_track_object_manager;
|
||||
m_track_object_manager = NULL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user