Merge pull request #594 from LuisAntonRebollo/unit-tests-without-crash

Increased stability Torque3D: unit-tests running without a crash.
This commit is contained in:
Daniel Buckmaster 2014-06-16 10:57:04 +10:00
commit feec36731e
18 changed files with 113 additions and 19 deletions

View file

@ -511,6 +511,12 @@ bool Debris::onAdd()
return false;
}
if( !mDataBlock )
{
Con::errorf("Debris::onAdd - Fail - No datablock");
return false;
}
// create emitters
for( S32 i=0; i<DebrisData::DDC_NUM_EMITTERS; i++ )
{
@ -653,8 +659,11 @@ void Debris::onRemove()
}
}
getSceneManager()->removeObjectFromScene(this);
getContainer()->removeObject(this);
if( getSceneManager() )
getSceneManager()->removeObjectFromScene(this);
if( getContainer() )
getContainer()->removeObject(this);
Parent::onRemove();
}