aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneGraph.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneGraph.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneGraph.cs15
1 files changed, 12 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneGraph.cs b/OpenSim/Region/Environment/Scenes/SceneGraph.cs
index be2fb46..940aee6 100644
--- a/OpenSim/Region/Environment/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneGraph.cs
@@ -774,7 +774,10 @@ namespace OpenSim.Region.Environment.Scenes
774 /// <returns></returns> 774 /// <returns></returns>
775 protected internal List<ScenePresence> GetScenePresences() 775 protected internal List<ScenePresence> GetScenePresences()
776 { 776 {
777 return new List<ScenePresence>(ScenePresences.Values); 777 lock (ScenePresences)
778 {
779 return new List<ScenePresence>(ScenePresences.Values);
780 }
778 } 781 }
779 782
780 protected internal List<ScenePresence> GetAvatars() 783 protected internal List<ScenePresence> GetAvatars()
@@ -1085,12 +1088,18 @@ namespace OpenSim.Region.Environment.Scenes
1085 1088
1086 protected internal void ForEachClient(Action<IClientAPI> action) 1089 protected internal void ForEachClient(Action<IClientAPI> action)
1087 { 1090 {
1088 lock (ScenePresences) 1091 List<ScenePresence> splist = GetScenePresences();
1092 foreach (ScenePresence presence in splist)
1089 { 1093 {
1090 foreach (ScenePresence presence in ScenePresences.Values) 1094 try
1091 { 1095 {
1092 action(presence.ControllingClient); 1096 action(presence.ControllingClient);
1093 } 1097 }
1098 catch (Exception e)
1099 {
1100 // Catch it and move on. This includes situations where splist has inconsistent info
1101 m_log.WarnFormat("[SCENE]: Problem processing action in ForEachClient: ", e.Message);
1102 }
1094 } 1103 }
1095 } 1104 }
1096 1105