Fixed #634 - crash when exiting a game with ghost

(ghost karts were not removed, causing problems when
drawing all later).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11252 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2012-05-20 00:29:03 +00:00
parent 3776189327
commit c6336649b3

View File

@@ -265,6 +265,16 @@ Controller* World::loadAIController(AbstractKart *kart)
//-----------------------------------------------------------------------------
World::~World()
{
if(ReplayPlay::get())
{
// Destroy the old replay object, which also stored the ghost
// karts, and create a new one (which means that in further
// races the usage of ghosts will still be enabled).
ReplayPlay::destroy();
ReplayPlay::create();
}
// In case that a race is aborted (e.g. track not found) m_track is 0.
if(m_track)
m_track->cleanup();