diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 24f62e3..1734704 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1222,6 +1222,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
1222 | 1222 | ||
1223 | m_sceneGraph.Close(); | 1223 | m_sceneGraph.Close(); |
1224 | 1224 | ||
1225 | if (PhysicsScene != null) | ||
1226 | { | ||
1227 | PhysicsScene phys = PhysicsScene; | ||
1228 | // remove the physics engine from both Scene and SceneGraph | ||
1229 | PhysicsScene = null; | ||
1230 | phys.Dispose(); | ||
1231 | phys = null; | ||
1232 | } | ||
1233 | |||
1225 | if (!GridService.DeregisterRegion(RegionInfo.RegionID)) | 1234 | if (!GridService.DeregisterRegion(RegionInfo.RegionID)) |
1226 | m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", Name); | 1235 | m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", Name); |
1227 | 1236 | ||
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index 32e81e2..0db936f 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs | |||
@@ -489,6 +489,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
489 | /// </summary> | 489 | /// </summary> |
490 | internal Object OdeLock = new Object(); | 490 | internal Object OdeLock = new Object(); |
491 | 491 | ||
492 | private bool _worldInitialized = false; | ||
493 | |||
492 | public IMesher mesher; | 494 | public IMesher mesher; |
493 | 495 | ||
494 | private IConfigSource m_config; | 496 | private IConfigSource m_config; |
@@ -875,6 +877,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
875 | staticPrimspace[i, j] = IntPtr.Zero; | 877 | staticPrimspace[i, j] = IntPtr.Zero; |
876 | } | 878 | } |
877 | } | 879 | } |
880 | |||
881 | _worldInitialized = true; | ||
878 | } | 882 | } |
879 | 883 | ||
880 | // internal void waitForSpaceUnlock(IntPtr space) | 884 | // internal void waitForSpaceUnlock(IntPtr space) |
@@ -2896,6 +2900,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2896 | /// <returns>The number of frames simulated over that period.</returns> | 2900 | /// <returns>The number of frames simulated over that period.</returns> |
2897 | public override float Simulate(float timeStep) | 2901 | public override float Simulate(float timeStep) |
2898 | { | 2902 | { |
2903 | if (!_worldInitialized) return 11f; | ||
2904 | |||
2899 | int startFrameTick = CollectStats ? Util.EnvironmentTickCount() : 0; | 2905 | int startFrameTick = CollectStats ? Util.EnvironmentTickCount() : 0; |
2900 | int tempTick = 0, tempTick2 = 0; | 2906 | int tempTick = 0, tempTick2 = 0; |
2901 | 2907 | ||
@@ -4017,6 +4023,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
4017 | 4023 | ||
4018 | public override void Dispose() | 4024 | public override void Dispose() |
4019 | { | 4025 | { |
4026 | _worldInitialized = false; | ||
4027 | |||
4020 | m_rayCastManager.Dispose(); | 4028 | m_rayCastManager.Dispose(); |
4021 | m_rayCastManager = null; | 4029 | m_rayCastManager = null; |
4022 | 4030 | ||
@@ -4037,6 +4045,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
4037 | d.WorldDestroy(world); | 4045 | d.WorldDestroy(world); |
4038 | //d.CloseODE(); | 4046 | //d.CloseODE(); |
4039 | } | 4047 | } |
4048 | |||
4040 | } | 4049 | } |
4041 | 4050 | ||
4042 | public override Dictionary<uint, float> GetTopColliders() | 4051 | public override Dictionary<uint, float> GetTopColliders() |