Fix the llRemoveInventory recursive lock error (again)

avinationmerge
meta7 2010-08-11 14:30:09 -07:00
parent 24577876be
commit 7aac4d650f
1 changed files with 13 additions and 11 deletions

View File

@ -4200,10 +4200,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
List<TaskInventoryItem> inv;
try try
{ {
m_host.TaskInventory.LockItemsForRead(true); m_host.TaskInventory.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_host.TaskInventory.Values) inv = new List<TaskInventoryItem>(m_host.TaskInventory.Values);
}
finally
{
m_host.TaskInventory.LockItemsForRead(false);
}
foreach (TaskInventoryItem item in inv)
{ {
if (item.Name == name) if (item.Name == name)
{ {
@ -4215,11 +4222,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
} }
} }
finally
{
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)
{ {