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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user