BulletSim: fix problem of a null reference exception on shutdown if there were linksets in the region.

integration
Robert Adams 2012-08-14 16:38:11 -07:00
parent 77a7758cf5
commit 257446889b
1 changed files with 13 additions and 12 deletions

View File

@ -595,12 +595,6 @@ public class BSScene : PhysicsScene, IPhysicsParameters
// make sure no stepping happens while we're deleting stuff
m_initialized = false;
if (m_constraintCollection != null)
{
m_constraintCollection.Dispose();
m_constraintCollection = null;
}
foreach (KeyValuePair<uint, BSCharacter> kvp in m_avatars)
{
kvp.Value.Destroy();
@ -613,6 +607,13 @@ public class BSScene : PhysicsScene, IPhysicsParameters
}
m_prims.Clear();
// Now that the prims are all cleaned up, there should be no constraints left
if (m_constraintCollection != null)
{
m_constraintCollection.Dispose();
m_constraintCollection = null;
}
// Anything left in the unmanaged code should be cleaned out
BulletSimAPI.Shutdown(WorldID);