diff options
author | Dr Scofield | 2008-06-25 12:21:51 +0000 |
---|---|---|
committer | Dr Scofield | 2008-06-25 12:21:51 +0000 |
commit | b713f4a540bb2f549ca3c5cb833120d9ba6f7c9d (patch) | |
tree | 29c681f8e566dd54be968a966b0ad17793c17d0e | |
parent | * Deleted some genned files (diff) | |
download | opensim-SC_OLD-b713f4a540bb2f549ca3c5cb833120d9ba6f7c9d.zip opensim-SC_OLD-b713f4a540bb2f549ca3c5cb833120d9ba6f7c9d.tar.gz opensim-SC_OLD-b713f4a540bb2f549ca3c5cb833120d9ba6f7c9d.tar.bz2 opensim-SC_OLD-b713f4a540bb2f549ca3c5cb833120d9ba6f7c9d.tar.xz |
taking another look at mantis #1502: adding necessary locks, checking for empty list.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/InnerScene.cs | 14 |
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() |