aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs14
1 files changed, 11 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index c0edaba..5acad88 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -122,7 +122,10 @@ namespace OpenSim.Region.Environment.Scenes
122 } 122 }
123 123
124 //SceneObjects.Clear(); 124 //SceneObjects.Clear();
125 Entities.Clear(); 125 lock (Entities)
126 {
127 Entities.Clear();
128 }
126 } 129 }
127 130
128 #region Update Methods 131 #region Update Methods
@@ -756,7 +759,8 @@ namespace OpenSim.Region.Environment.Scenes
756 // Primitive Ray Tracing 759 // Primitive Ray Tracing
757 float closestDistance = 280f; 760 float closestDistance = 280f;
758 EntityIntersection returnResult = new EntityIntersection(); 761 EntityIntersection returnResult = new EntityIntersection();
759 foreach (EntityBase ent in Entities.Values) 762 List<EntityBase> EntityList = GetEntities();
763 foreach (EntityBase ent in EntityList)
760 { 764 {
761 if (ent is SceneObjectGroup) 765 if (ent is SceneObjectGroup)
762 { 766 {
@@ -845,7 +849,11 @@ namespace OpenSim.Region.Environment.Scenes
845 /// <returns></returns> 849 /// <returns></returns>
846 protected internal List<EntityBase> GetEntities() 850 protected internal List<EntityBase> GetEntities()
847 { 851 {
848 return new List<EntityBase>(Entities.Values); 852 lock(Entities)
853 {
854 if (0 == Entities.Count) return null;
855 return new List<EntityBase>(Entities.Values);
856 }
849 } 857 }
850 858
851 protected internal Dictionary<uint, float> GetTopScripts() 859 protected internal Dictionary<uint, float> GetTopScripts()