From e3f153370566e0fd4b6f63a066e016cb52dcdf62 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 17 Sep 2010 01:21:28 +0100 Subject: Fix build break by replacing Items.LockItemsForWrite() with lock (Items) {} --- .../Framework/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 fbaa7d4..7ba30fc 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) - { - m_items.LockItemsForWrite(false); - 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) + lock (Items) { - item.ParentPartID = m_part.UUID; - item.ParentID = m_part.UUID; - Items.Add(item.ItemID, item); + 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); + } } - m_items.LockItemsForWrite(false); } /// -- cgit v1.1