Fix crash when exiting stk.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4665 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2010-02-07 22:52:25 +00:00
parent 0465313495
commit 9b577d89c8

View File

@@ -49,7 +49,8 @@ PowerupManager::~PowerupManager()
{
for(unsigned int i=POWERUP_FIRST; i<=POWERUP_LAST; i++)
{
m_all_meshes[(PowerupType)i]->drop();
if(m_all_meshes[(PowerupType)i])
m_all_meshes[(PowerupType)i]->drop();
}
} // ~PowerupManager
@@ -120,6 +121,7 @@ void PowerupManager::LoadPowerup(PowerupType type, const XMLNode &node)
o<<"Can't load model '"<<model<<"' for powerup type '"<<type<<"', aborting.";
throw std::runtime_error(o.str());
}
m_all_meshes[type]->grab();
}
else
{