diff options
author | Melanie | 2011-12-12 23:43:45 +0100 |
---|---|---|
committer | Melanie | 2011-12-12 23:43:45 +0100 |
commit | d18a9f22e798e239bf989bad2e261283fd737b73 (patch) | |
tree | 6dba11a705bbc85f5ab3df166f1ca97a211f601b | |
parent | Make m_attachments private (diff) | |
download | opensim-SC-d18a9f22e798e239bf989bad2e261283fd737b73.zip opensim-SC-d18a9f22e798e239bf989bad2e261283fd737b73.tar.gz opensim-SC-d18a9f22e798e239bf989bad2e261283fd737b73.tar.bz2 opensim-SC-d18a9f22e798e239bf989bad2e261283fd737b73.tar.xz |
Prevent a nasty deadlock on teleport
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 3b85a0f..49acc02 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3135,30 +3135,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
3135 | catch { } | 3135 | catch { } |
3136 | 3136 | ||
3137 | // Attachment objects | 3137 | // Attachment objects |
3138 | lock (m_attachments) | 3138 | List<SceneObjectGroup> attachments = GetAttachments(); |
3139 | { | 3139 | if (attachments.Count > 0) |
3140 | if (m_attachments.Count > 0) | 3140 | { |
3141 | { | 3141 | cAgent.AttachmentObjects = new List<ISceneObject>(); |
3142 | cAgent.AttachmentObjects = new List<ISceneObject>(); | 3142 | cAgent.AttachmentObjectStates = new List<string>(); |
3143 | cAgent.AttachmentObjectStates = new List<string>(); | 3143 | // IScriptModule se = m_scene.RequestModuleInterface<IScriptModule>(); |
3144 | // IScriptModule se = m_scene.RequestModuleInterface<IScriptModule>(); | 3144 | InTransitScriptStates.Clear(); |
3145 | InTransitScriptStates.Clear(); | 3145 | |
3146 | 3146 | foreach (SceneObjectGroup sog in attachments) | |
3147 | foreach (SceneObjectGroup sog in m_attachments) | 3147 | { |
3148 | { | 3148 | // We need to make a copy and pass that copy |
3149 | // We need to make a copy and pass that copy | 3149 | // because of transfers withn the same sim |
3150 | // because of transfers withn the same sim | 3150 | ISceneObject clone = sog.CloneForNewScene(); |
3151 | ISceneObject clone = sog.CloneForNewScene(); | 3151 | // Attachment module assumes that GroupPosition holds the offsets...! |
3152 | // Attachment module assumes that GroupPosition holds the offsets...! | 3152 | ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos; |
3153 | ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos; | 3153 | ((SceneObjectGroup)clone).IsAttachment = false; |
3154 | ((SceneObjectGroup)clone).IsAttachment = false; | 3154 | cAgent.AttachmentObjects.Add(clone); |
3155 | cAgent.AttachmentObjects.Add(clone); | 3155 | string state = sog.GetStateSnapshot(); |
3156 | string state = sog.GetStateSnapshot(); | 3156 | cAgent.AttachmentObjectStates.Add(state); |
3157 | cAgent.AttachmentObjectStates.Add(state); | 3157 | InTransitScriptStates.Add(state); |
3158 | InTransitScriptStates.Add(state); | 3158 | // Let's remove the scripts of the original object here |
3159 | // Let's remove the scripts of the original object here | 3159 | sog.RemoveScriptInstances(true); |
3160 | sog.RemoveScriptInstances(true); | ||
3161 | } | ||
3162 | } | 3160 | } |
3163 | } | 3161 | } |
3164 | } | 3162 | } |