* A few additional null checks in the Physics Scene and PhysicsActor so we don't try to enumerate dead null ODECharacter objects when things get *really* slow.

ThreadPoolClientBranch
Teravus Ovares 2008-02-21 14:51:39 +00:00
parent 89665faeaf
commit 640ad259d4
2 changed files with 6 additions and 11 deletions

View File

@ -139,10 +139,9 @@ namespace OpenSim.Region.Physics.Manager
if (handler != null) if (handler != null)
{ {
lock (handler)
{
handler(); handler();
}
} }
} }
@ -153,25 +152,19 @@ namespace OpenSim.Region.Physics.Manager
// immediately after the null check and before the event is raised. // immediately after the null check and before the event is raised.
OutOfBounds handler = OnOutOfBounds; OutOfBounds handler = OnOutOfBounds;
if (handler != null) if (handler != null)
{
lock (handler)
{ {
handler(pos); handler(pos);
} }
} }
}
public virtual void SendCollisionUpdate(EventArgs e) public virtual void SendCollisionUpdate(EventArgs e)
{ {
CollisionUpdate handler = OnCollisionUpdate; CollisionUpdate handler = OnCollisionUpdate;
if (handler != null) if (handler != null)
{
lock (handler)
{ {
handler(e); handler(e);
} }
}
} }

View File

@ -1272,6 +1272,7 @@ namespace OpenSim.Region.Physics.OdePlugin
{ {
foreach (OdeCharacter actor in _characters) foreach (OdeCharacter actor in _characters)
{ {
if (actor != null)
actor.Move(timeStep); actor.Move(timeStep);
} }
@ -1300,6 +1301,7 @@ namespace OpenSim.Region.Physics.OdePlugin
foreach (OdeCharacter actor in _characters) foreach (OdeCharacter actor in _characters)
{ {
if (actor != null)
actor.UpdatePositionAndVelocity(); actor.UpdatePositionAndVelocity();
} }