From 9bd6befdeb1dd6983f0ccfd05e1ee12596d1c0be Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 12 Nov 2015 21:24:14 +0000 Subject: [PATCH] add some safeguard checks --- OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs index 42bd8496ef..10a5588e5d 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs @@ -1131,7 +1131,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde { foreach (OdeCharacter chr in _characters) { - if (chr == null || chr.Body == IntPtr.Zero) + if (chr == null || chr.Body == IntPtr.Zero || chr.collider == IntPtr.Zero ) continue; chr.IsColliding = false; @@ -1161,13 +1161,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde aprim.IsColliding = false; } } - lock (_activeprims) + lock (_activegroups) { try { foreach (OdePrim aprim in _activegroups) { - if(!aprim.m_outbounds && d.BodyIsEnabled(aprim.Body)) + if(!aprim.m_outbounds && d.BodyIsEnabled(aprim.Body) && + aprim.collide_geom != IntPtr.Zero) { d.SpaceCollide2(StaticSpace, aprim.collide_geom, IntPtr.Zero, nearCallback); d.SpaceCollide2(GroundSpace, aprim.collide_geom, IntPtr.Zero, nearCallback);