From 984cf943757b15f05c2cfcb540c6647754a531e7 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 3 Feb 2009 19:36:57 +0000 Subject: * Lock the parts for the old group while we're clearing it as well - not much point doing one without the other * Shouldn't result in any deadlocks as I don't think there are any locks in the calling code --- OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 8 ++++++-- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index bdede36..9c29338 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -2049,8 +2049,12 @@ namespace OpenSim.Region.Environment.Scenes } m_scene.UnlinkSceneObject(objectGroup.UUID, true); - objectGroup.m_isDeleted = true; - objectGroup.m_parts.Clear(); + objectGroup.m_isDeleted = true; + + lock (objectGroup.m_parts) + { + objectGroup.m_parts.Clear(); + } // Can't do this yet since backup still makes use of the root part without any synchronization // objectGroup.m_rootPart = null; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 8cd0bf2..8fb94b0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3097,10 +3097,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ScenePresence sp = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter); if (sp != null) client = sp.ControllingClient; + SceneObjectPart targetPart = World.GetSceneObjectPart((UUID)target); + if (targetPart.ParentGroup.RootPart.AttachmentPoint != 0) return; // Fail silently if attached SceneObjectGroup parentPrim = null, childPrim = null; + if (targetPart != null) { if (parent != 0) { @@ -3118,10 +3121,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // if (uf != (Byte)0) // parent.RootPart.UpdateFlag = uf; } + parentPrim.TriggerScriptChangedEvent(Changed.LINK); parentPrim.RootPart.AddFlag(PrimFlags.CreateSelected); parentPrim.HasGroupChanged = true; parentPrim.ScheduleGroupForFullUpdate(); + if (client != null) parentPrim.GetProperties(client); -- cgit v1.1