diff options
author | Melanie Thielker | 2010-06-01 19:01:21 +0200 |
---|---|---|
committer | Melanie | 2010-06-01 19:01:57 +0100 |
commit | a863eb9da3eba3644933b7622239dde641e7050c (patch) | |
tree | 33fa803d385940d39ad4d4b14d2e6bddfb288d11 /OpenSim/Region/Framework | |
parent | Lock the object queue when dequeueing (diff) | |
download | opensim-SC_OLD-a863eb9da3eba3644933b7622239dde641e7050c.zip opensim-SC_OLD-a863eb9da3eba3644933b7622239dde641e7050c.tar.gz opensim-SC_OLD-a863eb9da3eba3644933b7622239dde641e7050c.tar.bz2 opensim-SC_OLD-a863eb9da3eba3644933b7622239dde641e7050c.tar.xz |
One should not lock null objects.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneViewer.cs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneViewer.cs b/OpenSim/Region/Framework/Scenes/SceneViewer.cs index 5cbd8d9..f478a4a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneViewer.cs +++ b/OpenSim/Region/Framework/Scenes/SceneViewer.cs | |||
@@ -67,14 +67,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
67 | 67 | ||
68 | public void SendPrimUpdates() | 68 | public void SendPrimUpdates() |
69 | { | 69 | { |
70 | lock(m_pendingObjects) | 70 | if (m_pendingObjects == null) |
71 | { | 71 | { |
72 | if (m_pendingObjects == null) | 72 | if (!m_presence.IsChildAgent || (m_presence.Scene.m_seeIntoRegionFromNeighbor)) |
73 | { | 73 | { |
74 | if (!m_presence.IsChildAgent || (m_presence.Scene.m_seeIntoRegionFromNeighbor)) | 74 | m_pendingObjects = new Queue<SceneObjectGroup>(); |
75 | { | ||
76 | m_pendingObjects = new Queue<SceneObjectGroup>(); | ||
77 | 75 | ||
76 | lock(m_pendingObjects) | ||
77 | { | ||
78 | foreach (EntityBase e in m_presence.Scene.Entities) | 78 | foreach (EntityBase e in m_presence.Scene.Entities) |
79 | { | 79 | { |
80 | if (e != null && e is SceneObjectGroup) | 80 | if (e != null && e is SceneObjectGroup) |
@@ -82,7 +82,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
82 | } | 82 | } |
83 | } | 83 | } |
84 | } | 84 | } |
85 | } | ||
85 | 86 | ||
87 | lock(m_pendingObjects) | ||
88 | { | ||
86 | while (m_pendingObjects != null && m_pendingObjects.Count > 0) | 89 | while (m_pendingObjects != null && m_pendingObjects.Count > 0) |
87 | { | 90 | { |
88 | SceneObjectGroup g = m_pendingObjects.Dequeue(); | 91 | SceneObjectGroup g = m_pendingObjects.Dequeue(); |