add a lock to CollisionEventsThisFrame

avinationmerge
UbitUmarov 2013-01-02 20:06:57 +00:00
parent 7980a1d849
commit be6b6bf191
1 changed files with 30 additions and 21 deletions

View File

@ -1539,10 +1539,13 @@ namespace OpenSim.Region.Physics.OdePlugin
public override void UnSubscribeEvents()
{
if (CollisionEventsThisFrame != null)
{
lock (CollisionEventsThisFrame)
{
CollisionEventsThisFrame.Clear();
CollisionEventsThisFrame = null;
}
}
m_eventsubscription = 0;
}
@ -1550,15 +1553,20 @@ namespace OpenSim.Region.Physics.OdePlugin
{
if (CollisionEventsThisFrame == null)
CollisionEventsThisFrame = new CollisionEventUpdate();
lock (CollisionEventsThisFrame)
{
CollisionEventsThisFrame.AddCollider(CollidedWith, contact);
_parent_scene.AddCollisionEventReporting(this);
}
}
public void SendCollisions()
{
if (CollisionEventsThisFrame == null)
return;
lock (CollisionEventsThisFrame)
{
if (m_cureventsubscription < m_eventsubscription)
return;
@ -1582,6 +1590,7 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
}
}
internal void AddCollisionFrameTime(int t)
{