From 61a7566381395a903049be66f40da48c3ffda94c Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 25 Apr 2016 20:27:23 +0200 Subject: Fire detach events even in temp attachments. They don't really need it but keeping the tests happy --- .../Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 3d90fa6..3b13e3f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -779,7 +779,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments // on detach. It's likely a temp attachment. if (so.FromItemID != UUID.Zero) { - sp.RemoveAttachment(so); + lock (sp.AttachmentsSyncLock) + { + bool changed = sp.Appearance.DetachAttachment(so.FromItemID); + if (changed && m_scene.AvatarFactory != null) + m_scene.AvatarFactory.QueueAppearanceSave(sp.UUID); + + sp.RemoveAttachment(so); + } + m_scene.DeleteSceneObject(so, false, false); so.RemoveScriptInstances(true); so.Clear(); -- cgit v1.1