lock attachments when enumerating through them in ScenePresence.CopyTo().
May have some effect on http://opensimulator.org/mantis/view.php?id=5644remove-scene-viewer
parent
9c32b131fd
commit
728fd0b1b8
|
@ -441,7 +441,6 @@ namespace OpenSim.Framework
|
|||
args["controllers"] = controls;
|
||||
}
|
||||
|
||||
|
||||
if ((CallbackURI != null) && (!CallbackURI.Equals("")))
|
||||
args["callback_uri"] = OSD.FromString(CallbackURI);
|
||||
|
||||
|
|
|
@ -3141,26 +3141,30 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
catch { }
|
||||
|
||||
// Attachment objects
|
||||
if (m_attachments != null && m_attachments.Count > 0)
|
||||
lock (m_attachments)
|
||||
{
|
||||
cAgent.AttachmentObjects = new List<ISceneObject>();
|
||||
cAgent.AttachmentObjectStates = new List<string>();
|
||||
// IScriptModule se = m_scene.RequestModuleInterface<IScriptModule>();
|
||||
m_InTransitScriptStates.Clear();
|
||||
foreach (SceneObjectGroup sog in m_attachments)
|
||||
if (m_attachments.Count > 0)
|
||||
{
|
||||
// We need to make a copy and pass that copy
|
||||
// because of transfers withn the same sim
|
||||
ISceneObject clone = sog.CloneForNewScene();
|
||||
// Attachment module assumes that GroupPosition holds the offsets...!
|
||||
((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos;
|
||||
((SceneObjectGroup)clone).IsAttachment = false;
|
||||
cAgent.AttachmentObjects.Add(clone);
|
||||
string state = sog.GetStateSnapshot();
|
||||
cAgent.AttachmentObjectStates.Add(state);
|
||||
m_InTransitScriptStates.Add(state);
|
||||
// Let's remove the scripts of the original object here
|
||||
sog.RemoveScriptInstances(true);
|
||||
cAgent.AttachmentObjects = new List<ISceneObject>();
|
||||
cAgent.AttachmentObjectStates = new List<string>();
|
||||
// IScriptModule se = m_scene.RequestModuleInterface<IScriptModule>();
|
||||
m_InTransitScriptStates.Clear();
|
||||
|
||||
foreach (SceneObjectGroup sog in m_attachments)
|
||||
{
|
||||
// We need to make a copy and pass that copy
|
||||
// because of transfers withn the same sim
|
||||
ISceneObject clone = sog.CloneForNewScene();
|
||||
// Attachment module assumes that GroupPosition holds the offsets...!
|
||||
((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos;
|
||||
((SceneObjectGroup)clone).IsAttachment = false;
|
||||
cAgent.AttachmentObjects.Add(clone);
|
||||
string state = sog.GetStateSnapshot();
|
||||
cAgent.AttachmentObjectStates.Add(state);
|
||||
m_InTransitScriptStates.Add(state);
|
||||
// Let's remove the scripts of the original object here
|
||||
sog.RemoveScriptInstances(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue