From f3b1efd889e2e87f89c8e8da6a08089596c878f6 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sat, 15 Dec 2012 11:31:26 -0800 Subject: BulletSim: remove some errors on shutdown by moving terrain destruction until after physical object destruction. TerrainManager also made disposable and that feature used. --- OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index cf5bb57..ac99777 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs @@ -349,8 +349,6 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters // make sure no stepping happens while we're deleting stuff m_initialized = false; - TerrainManager.ReleaseGroundPlaneAndTerrain(); - foreach (KeyValuePair kvp in PhysObjects) { kvp.Value.Destroy(); @@ -370,6 +368,13 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters Shapes = null; } + if (TerrainManager != null) + { + TerrainManager.ReleaseGroundPlaneAndTerrain(); + TerrainManager.Dispose(); + TerrainManager = null; + } + // Anything left in the unmanaged code should be cleaned out BulletSimAPI.Shutdown2(World.ptr); -- cgit v1.1