Fix crash when installing a new kart (#459).
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9982 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
95a42cbb9d
commit
ba6094d256
@ -145,8 +145,19 @@ KartModel::~KartModel()
|
||||
|
||||
m_wheel_node[i]->drop();
|
||||
}
|
||||
if(m_is_master && m_wheel_model[i])
|
||||
irr_driver->dropAllTextures(m_wheel_model[i]);
|
||||
// For now don't drop the textures: note that the mesh is not
|
||||
// dropped either (which enables a reload of kart_properties
|
||||
// without reading the full mesh again when a new addon is
|
||||
// installed, see KartPropertiesManager::reLoadAllKarts).
|
||||
// Therefore if the textures are dropped here, the mesh would
|
||||
// reference a freed texture, causing a crash.
|
||||
// While this potentially causes a memory leak, this is not
|
||||
// important since all kart meshes and all textures they use
|
||||
// are around till the very end of STK. The textures stay in
|
||||
// irrlicht's texture cache, and will be freed on exit.
|
||||
//if(m_is_master && m_wheel_model[i])
|
||||
// irr_driver->dropAllTextures(m_wheel_model[i]);
|
||||
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
Loading…
Reference in New Issue
Block a user