Attempt to fix desctructor of TrackObject + fix issue with texture retention
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10045 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
953e8cf1ef
commit
66ad858aa8
@ -164,6 +164,7 @@ TrackObject::TrackObject(const core::vector3df& pos, const core::vector3df& hpr,
|
|||||||
{
|
{
|
||||||
m_mesh = model;
|
m_mesh = model;
|
||||||
m_mesh->grab();
|
m_mesh->grab();
|
||||||
|
irr_driver->grabAllTextures(m_mesh);
|
||||||
|
|
||||||
scene::IMeshSceneNode *node = irr_driver->addMesh(model);
|
scene::IMeshSceneNode *node = irr_driver->addMesh(model);
|
||||||
m_node = node;
|
m_node = node;
|
||||||
@ -195,9 +196,9 @@ TrackObject::~TrackObject()
|
|||||||
if(m_mesh)
|
if(m_mesh)
|
||||||
{
|
{
|
||||||
irr_driver->dropAllTextures(m_mesh);
|
irr_driver->dropAllTextures(m_mesh);
|
||||||
m_mesh->drop();
|
|
||||||
if(m_mesh->getReferenceCount()==1)
|
if(m_mesh->getReferenceCount()==1)
|
||||||
irr_driver->removeMeshFromCache(m_mesh);
|
irr_driver->removeMeshFromCache(m_mesh);
|
||||||
|
m_mesh->drop();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_sound)
|
if (m_sound)
|
||||||
|
Loading…
Reference in New Issue
Block a user