Fix a dangling lock issue in llRemoveInventory

avinationmerge
meta7 2010-08-10 09:50:18 -07:00
parent fb14390fb0
commit 48c52d6e48
1 changed files with 15 additions and 11 deletions

View File

@ -4200,6 +4200,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
try
{
m_host.TaskInventory.LockItemsForRead(true); m_host.TaskInventory.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_host.TaskInventory.Values) foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
{ {
@ -4209,13 +4211,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
throw new ScriptDeleteException(); throw new ScriptDeleteException();
else else
m_host.Inventory.RemoveInventoryItem(item.ItemID); m_host.Inventory.RemoveInventoryItem(item.ItemID);
m_host.TaskInventory.LockItemsForRead(false);
return; return;
} }
} }
}
finally
{
m_host.TaskInventory.LockItemsForRead(false); m_host.TaskInventory.LockItemsForRead(false);
} }
}
public void llSetText(string text, LSL_Vector color, double alpha) public void llSetText(string text, LSL_Vector color, double alpha)
{ {