diff options
author | Dan Lake | 2010-03-17 06:40:00 -0700 |
---|---|---|
committer | John Hurliman | 2010-03-17 11:21:27 -0700 |
commit | 73e9b0be725a73a489b29f3fe2df236c897ef3b5 (patch) | |
tree | 0d039d61d327e98ed22e4bce30de65c24fc5780d /OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |
parent | minor logging changes to BaseHttpServer, OSHttpRequest (diff) | |
download | opensim-SC_OLD-73e9b0be725a73a489b29f3fe2df236c897ef3b5.zip opensim-SC_OLD-73e9b0be725a73a489b29f3fe2df236c897ef3b5.tar.gz opensim-SC_OLD-73e9b0be725a73a489b29f3fe2df236c897ef3b5.tar.bz2 opensim-SC_OLD-73e9b0be725a73a489b29f3fe2df236c897ef3b5.tar.xz |
Inconsistent locking of ScenePresence array in SceneGraph. Fixed by eliminating option to return the actual list. Callers can now either request a copy of the array as a new List or ask the SceneGraph to call a delegate function on every ScenePresence. Iteration and locking of the ScenePresences now takes place only within the SceneGraph class.
This patch also applies a fix to Combat/CombatModule.cs which had unlocked iteration of the ScenePresences and inconsistent try/catch around the use of those ScenePresences.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 88deedf..8aefd50 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1268,22 +1268,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
1268 | foreach (SceneObjectPart part in m_parts.Values) | 1268 | foreach (SceneObjectPart part in m_parts.Values) |
1269 | { | 1269 | { |
1270 | // part.Inventory.RemoveScriptInstances(); | 1270 | // part.Inventory.RemoveScriptInstances(); |
1271 | 1271 | Scene.ForEachScenePresence(delegate(ScenePresence avatar) | |
1272 | ScenePresence[] avatars = Scene.GetScenePresences(); | ||
1273 | for (int i = 0; i < avatars.Length; i++) | ||
1274 | { | 1272 | { |
1275 | if (avatars[i].ParentID == LocalId) | 1273 | if (avatar.ParentID == LocalId) |
1276 | { | 1274 | { |
1277 | avatars[i].StandUp(); | 1275 | avatar.StandUp(); |
1278 | } | 1276 | } |
1279 | 1277 | ||
1280 | if (!silent) | 1278 | if (!silent) |
1281 | { | 1279 | { |
1282 | part.UpdateFlag = 0; | 1280 | part.UpdateFlag = 0; |
1283 | if (part == m_rootPart) | 1281 | if (part == m_rootPart) |
1284 | avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); | 1282 | avatar.ControllingClient.SendKillObject(m_regionHandle, part.LocalId); |
1285 | } | 1283 | } |
1286 | } | 1284 | }); |
1287 | } | 1285 | } |
1288 | } | 1286 | } |
1289 | } | 1287 | } |