From 9e914f5c321d5588b196221343e3bc9ed9735f64 Mon Sep 17 00:00:00 2001
From: Robert Adams
Date: Thu, 26 Jul 2012 16:03:15 -0700
Subject: Add check so Ode does not try to simulate after it has been
Dispose()'ed. Fixes exception that happens when shutting down region
(improvements from last patch)
---
OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 9 +++++++++
1 file changed, 9 insertions(+)
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
///
internal Object OdeLock = new Object();
+ private bool _worldInitialized = false;
+
public IMesher mesher;
private IConfigSource m_config;
@@ -875,6 +877,8 @@ namespace OpenSim.Region.Physics.OdePlugin
staticPrimspace[i, j] = IntPtr.Zero;
}
}
+
+ _worldInitialized = true;
}
// internal void waitForSpaceUnlock(IntPtr space)
@@ -2896,6 +2900,8 @@ namespace OpenSim.Region.Physics.OdePlugin
/// The number of frames simulated over that period.
public override float Simulate(float timeStep)
{
+ if (!_worldInitialized) return 11f;
+
int startFrameTick = CollectStats ? Util.EnvironmentTickCount() : 0;
int tempTick = 0, tempTick2 = 0;
@@ -4017,6 +4023,8 @@ namespace OpenSim.Region.Physics.OdePlugin
public override void Dispose()
{
+ _worldInitialized = false;
+
m_rayCastManager.Dispose();
m_rayCastManager = null;
@@ -4037,6 +4045,7 @@ namespace OpenSim.Region.Physics.OdePlugin
d.WorldDestroy(world);
//d.CloseODE();
}
+
}
public override Dictionary GetTopColliders()
--
cgit v1.1