mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
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.
This commit is contained in:
@@ -1268,22 +1268,20 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
foreach (SceneObjectPart part in m_parts.Values)
|
||||
{
|
||||
// part.Inventory.RemoveScriptInstances();
|
||||
|
||||
ScenePresence[] avatars = Scene.GetScenePresences();
|
||||
for (int i = 0; i < avatars.Length; i++)
|
||||
Scene.ForEachScenePresence(delegate(ScenePresence avatar)
|
||||
{
|
||||
if (avatars[i].ParentID == LocalId)
|
||||
if (avatar.ParentID == LocalId)
|
||||
{
|
||||
avatars[i].StandUp();
|
||||
avatar.StandUp();
|
||||
}
|
||||
|
||||
if (!silent)
|
||||
{
|
||||
part.UpdateFlag = 0;
|
||||
if (part == m_rootPart)
|
||||
avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId);
|
||||
avatar.ControllingClient.SendKillObject(m_regionHandle, part.LocalId);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user