Fixed crash (m_mesh counter was decreased for non-master object, resulting

in the master mesh disappearing).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12516 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2013-02-18 22:00:27 +00:00
parent 392a1397e9
commit 3cfa2dbf9c

View File

@ -169,15 +169,17 @@ KartModel::~KartModel()
}
}
if(m_is_master)
{
m_mesh->drop();
// If there is only one copy left, it's the copy in irrlicht's
// mesh cache, so it can be remove.
if(m_is_master && m_mesh != NULL && m_mesh->getReferenceCount()==1)
if(m_mesh && m_mesh->getReferenceCount()==1)
{
irr_driver->dropAllTextures(m_mesh);
irr_driver->removeMeshFromCache(m_mesh);
}
}
#ifdef DEBUG
#if SKELETON_DEBUG