lock attachments when enumerating through them in ScenePresence.CopyTo().

May have some effect on http://opensimulator.org/mantis/view.php?id=5644
remove-scene-viewer
Justin Clark-Casey (justincc) 2011-09-10 01:09:17 +01:00
parent 9c32b131fd
commit 728fd0b1b8
2 changed files with 22 additions and 19 deletions

View File

@ -441,7 +441,6 @@ namespace OpenSim.Framework
args["controllers"] = controls; args["controllers"] = controls;
} }
if ((CallbackURI != null) && (!CallbackURI.Equals(""))) if ((CallbackURI != null) && (!CallbackURI.Equals("")))
args["callback_uri"] = OSD.FromString(CallbackURI); args["callback_uri"] = OSD.FromString(CallbackURI);

View File

@ -3141,12 +3141,15 @@ namespace OpenSim.Region.Framework.Scenes
catch { } catch { }
// Attachment objects // Attachment objects
if (m_attachments != null && m_attachments.Count > 0) lock (m_attachments)
{
if (m_attachments.Count > 0)
{ {
cAgent.AttachmentObjects = new List<ISceneObject>(); cAgent.AttachmentObjects = new List<ISceneObject>();
cAgent.AttachmentObjectStates = new List<string>(); cAgent.AttachmentObjectStates = new List<string>();
// IScriptModule se = m_scene.RequestModuleInterface<IScriptModule>(); // IScriptModule se = m_scene.RequestModuleInterface<IScriptModule>();
m_InTransitScriptStates.Clear(); m_InTransitScriptStates.Clear();
foreach (SceneObjectGroup sog in m_attachments) foreach (SceneObjectGroup sog in m_attachments)
{ {
// We need to make a copy and pass that copy // We need to make a copy and pass that copy
@ -3164,6 +3167,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
} }
}
public void CopyFrom(AgentData cAgent) public void CopyFrom(AgentData cAgent)
{ {