One should not lock null objects.

soprefactor
Melanie Thielker 2010-06-01 19:01:21 +02:00 committed by Melanie
parent 9c3c020697
commit a863eb9da3
1 changed files with 8 additions and 5 deletions

View File

@ -67,14 +67,14 @@ namespace OpenSim.Region.Framework.Scenes
public void SendPrimUpdates()
{
lock(m_pendingObjects)
if (m_pendingObjects == null)
{
if (m_pendingObjects == null)
if (!m_presence.IsChildAgent || (m_presence.Scene.m_seeIntoRegionFromNeighbor))
{
if (!m_presence.IsChildAgent || (m_presence.Scene.m_seeIntoRegionFromNeighbor))
{
m_pendingObjects = new Queue<SceneObjectGroup>();
m_pendingObjects = new Queue<SceneObjectGroup>();
lock(m_pendingObjects)
{
foreach (EntityBase e in m_presence.Scene.Entities)
{
if (e != null && e is SceneObjectGroup)
@ -82,7 +82,10 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
}
lock(m_pendingObjects)
{
while (m_pendingObjects != null && m_pendingObjects.Count > 0)
{
SceneObjectGroup g = m_pendingObjects.Dequeue();