Fix build break by replacing Items.LockItemsForWrite() with lock (Items) {}

viewer-2-initial-appearance
Justin Clark-Casey (justincc) 2010-09-17 01:21:28 +01:00
parent 5072429263
commit e3f1533705
1 changed files with 21 additions and 22 deletions

View File

@ -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<TaskInventoryItem> items = new List<TaskInventoryItem>(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<TaskInventoryItem> items = new List<TaskInventoryItem>(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);
}
/// <summary>