From e3f153370566e0fd4b6f63a066e016cb52dcdf62 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 17 Sep 2010 01:21:28 +0100 Subject: [PATCH] Fix build break by replacing Items.LockItemsForWrite() with lock (Items) {} --- .../Scenes/SceneObjectPartInventory.cs | 43 +++++++++---------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index fbaa7d4872..7ba30fcafa 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -142,30 +142,29 @@ namespace OpenSim.Region.Framework.Scenes public void ResetObjectID() { - m_items.LockItemsForWrite(true); - - if (Items.Count == 0) + lock (Items) { - m_items.LockItemsForWrite(false); - return; + if (Items.Count == 0) + { + return; + } + + HasInventoryChanged = true; + if (m_part.ParentGroup != null) + { + m_part.ParentGroup.HasGroupChanged = true; + } + + IList items = new List(Items.Values); + Items.Clear(); + + foreach (TaskInventoryItem item in items) + { + item.ParentPartID = m_part.UUID; + item.ParentID = m_part.UUID; + Items.Add(item.ItemID, item); + } } - - HasInventoryChanged = true; - if (m_part.ParentGroup != null) - { - m_part.ParentGroup.HasGroupChanged = true; - } - - IList items = new List(Items.Values); - Items.Clear(); - - foreach (TaskInventoryItem item in items) - { - item.ParentPartID = m_part.UUID; - item.ParentID = m_part.UUID; - Items.Add(item.ItemID, item); - } - m_items.LockItemsForWrite(false); } ///