refactor: In llGetNumberOfNotecardLines() use existing GetInventoryItem() rather than inspecting a clone of the TaskInventory dictionary that was not cloned thread-safe

0.7.4.1
Justin Clark-Casey (justincc) 2012-07-04 21:57:57 +01:00
parent eacba4fc0b
commit 1816ecb747
1 changed files with 4 additions and 10 deletions

View File

@ -10502,20 +10502,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
TaskInventoryDictionary itemsDictionary = (TaskInventoryDictionary)m_host.TaskInventory.Clone();
UUID assetID = UUID.Zero;
if (!UUID.TryParse(name, out assetID))
{
foreach (TaskInventoryItem item in itemsDictionary.Values)
{
if (item.Type == 7 && item.Name == name)
{
assetID = item.AssetID;
break;
}
}
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name);
if (item != null && item.Type == 7)
assetID = item.AssetID;
}
if (assetID == UUID.Zero)