Add a Dispose() of the physics engine when a scene is being shutdown.

0.7.4.1
Robert Adams 2012-07-26 15:27:18 -07:00
parent c6d02801db
commit c1503205c0
1 changed files with 9 additions and 0 deletions

View File

@ -1222,6 +1222,15 @@ namespace OpenSim.Region.Framework.Scenes
m_sceneGraph.Close(); m_sceneGraph.Close();
if (PhysicsScene != null)
{
PhysicsScene phys = PhysicsScene;
// remove the physics engine from both Scene and SceneGraph
PhysicsScene = null;
phys.Dispose();
phys = null;
}
if (!GridService.DeregisterRegion(RegionInfo.RegionID)) if (!GridService.DeregisterRegion(RegionInfo.RegionID))
m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", Name); m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", Name);