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

@ -605,6 +605,7 @@ bool SceneManager::addObjectToScene( SceneObject* object )
void SceneManager::removeObjectFromScene( SceneObject* obj )
{
AssertFatal( obj, "SceneManager::removeObjectFromScene - Object is not declared" );
AssertFatal( obj->getSceneManager() == this, "SceneManager::removeObjectFromScene - Object not part of SceneManager" );
// Notify the object.
@ -613,7 +614,8 @@ void SceneManager::removeObjectFromScene( SceneObject* obj )
// Remove the object from the container.
getContainer()->removeObject( obj );
if( getContainer() )
getContainer()->removeObject( obj );
// Remove the object from the zoning system.