From 6b3f10790eb72a6c0fa3e5d088d681d28fc835dd Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 3 Aug 2014 19:35:16 +0100 Subject: [PATCH] bugg --- .../Avatar/Attachments/AttachmentsModule.cs | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 9e6ed913c7..5bc6631199 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -390,7 +390,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments if (sp.PresenceType != PresenceType.Npc) { - m_log.DebugFormat("[ATTACHMENTS MODULE]: enter PrepareScriptInstanceForSave loop"); foreach (SceneObjectGroup so in attachments) { // Scripts MUST be snapshotted before the object is @@ -400,18 +399,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments // scripts performing attachment operations at the same time. Getting object states stops the scripts. scriptStates[so] = PrepareScriptInstanceForSave(so, false); } - } - m_log.DebugFormat("[ATTACHMENTS MODULE]: enter UpdateDetachedObject loop"); - lock (sp.AttachmentsSyncLock) + lock (sp.AttachmentsSyncLock) + { + foreach (SceneObjectGroup so in attachments) + UpdateDetachedObject(sp, so, scriptStates[so]); + sp.ClearAttachments(); + } + } + else { - foreach (SceneObjectGroup so in attachments) - UpdateDetachedObject(sp, so, scriptStates[so]); - m_log.DebugFormat("[ATTACHMENTS MODULE]: enter ClearAttachments"); - sp.ClearAttachments(); - } - m_log.DebugFormat("[ATTACHMENTS MODULE]: derez done"); - + lock (sp.AttachmentsSyncLock) + { + foreach (SceneObjectGroup so in attachments) + UpdateDetachedObject(sp, so, String.Empty); + sp.ClearAttachments(); + } + } } public void DeleteAttachmentsFromScene(IScenePresence sp, bool silent)