Remove two causes of recursive locking. Merge artefact cleanup.

avinationmerge
Melanie 2012-06-06 20:36:47 +02:00
parent e09a74493f
commit 67483a6e50
1 changed files with 6 additions and 8 deletions

View File

@ -176,16 +176,14 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="ownerId"></param> /// <param name="ownerId"></param>
public void ChangeInventoryOwner(UUID ownerId) public void ChangeInventoryOwner(UUID ownerId)
{ {
m_items.LockItemsForWrite(true); List<TaskInventoryItem> items = GetInventoryItems();
if (0 == Items.Count)
{
m_items.LockItemsForWrite(false);
return;
}
if (items.Count == 0)
return;
m_items.LockItemsForWrite(true);
HasInventoryChanged = true; HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true; m_part.ParentGroup.HasGroupChanged = true;
List<TaskInventoryItem> items = GetInventoryItems();
foreach (TaskInventoryItem item in items) foreach (TaskInventoryItem item in items)
{ {
if (ownerId != item.OwnerID) if (ownerId != item.OwnerID)
@ -766,8 +764,8 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (item.Name == name) if (item.Name == name)
{ {
return item;
m_items.LockItemsForRead(false); m_items.LockItemsForRead(false);
return item;
} }
} }
m_items.LockItemsForRead(false); m_items.LockItemsForRead(false);