mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
Fix the llRemoveInventory recursive lock error (again)
This commit is contained in:
@@ -4200,25 +4200,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
List<TaskInventoryItem> inv;
|
||||
try
|
||||
{
|
||||
m_host.TaskInventory.LockItemsForRead(true);
|
||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
||||
{
|
||||
if (item.Name == name)
|
||||
{
|
||||
if (item.ItemID == m_itemID)
|
||||
throw new ScriptDeleteException();
|
||||
else
|
||||
m_host.Inventory.RemoveInventoryItem(item.ItemID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
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.ItemID == m_itemID)
|
||||
throw new ScriptDeleteException();
|
||||
else
|
||||
m_host.Inventory.RemoveInventoryItem(item.ItemID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void llSetText(string text, LSL_Vector color, double alpha)
|
||||
|
||||
Reference in New Issue
Block a user