One should not lock null objects.

avinationmerge
Melanie Thielker 2010-06-01 19:01:21 +02:00
parent c900134f91
commit 6668c789d3
1 changed files with 8 additions and 5 deletions

View File

@ -66,8 +66,6 @@ namespace OpenSim.Region.Framework.Scenes
} }
public void SendPrimUpdates() public void SendPrimUpdates()
{
lock(m_pendingObjects)
{ {
if (m_pendingObjects == null) if (m_pendingObjects == null)
{ {
@ -75,6 +73,8 @@ namespace OpenSim.Region.Framework.Scenes
{ {
m_pendingObjects = new Queue<SceneObjectGroup>(); m_pendingObjects = new Queue<SceneObjectGroup>();
lock(m_pendingObjects)
{
foreach (EntityBase e in m_presence.Scene.Entities) foreach (EntityBase e in m_presence.Scene.Entities)
{ {
if (e != null && e is SceneObjectGroup) 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) while (m_pendingObjects != null && m_pendingObjects.Count > 0)
{ {
SceneObjectGroup g = m_pendingObjects.Dequeue(); SceneObjectGroup g = m_pendingObjects.Dequeue();