aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-07-04 21:57:57 +0100
committerJustin Clark-Casey (justincc)2012-07-04 21:57:57 +0100
commit1816ecb747708fea73eec08d3e51a8a2b8c7bd06 (patch)
treed6b5838189e784178573cac48227a9793ddac9a2 /OpenSim/Region/ScriptEngine/Shared
parentrefactor: use existing GetInventoryItem() in GetScriptByName(), itself rename... (diff)
downloadopensim-SC_OLD-1816ecb747708fea73eec08d3e51a8a2b8c7bd06.zip
opensim-SC_OLD-1816ecb747708fea73eec08d3e51a8a2b8c7bd06.tar.gz
opensim-SC_OLD-1816ecb747708fea73eec08d3e51a8a2b8c7bd06.tar.bz2
opensim-SC_OLD-1816ecb747708fea73eec08d3e51a8a2b8c7bd06.tar.xz
refactor: In llGetNumberOfNotecardLines() use existing GetInventoryItem() rather than inspecting a clone of the TaskInventory dictionary that was not cloned thread-safe
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs14
1 files changed, 4 insertions, 10 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 38f146f..2b8c4c1 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -10502,20 +10502,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10502 { 10502 {
10503 m_host.AddScriptLPS(1); 10503 m_host.AddScriptLPS(1);
10504 10504
10505 TaskInventoryDictionary itemsDictionary = (TaskInventoryDictionary)m_host.TaskInventory.Clone();
10506
10507 UUID assetID = UUID.Zero; 10505 UUID assetID = UUID.Zero;
10508 10506
10509 if (!UUID.TryParse(name, out assetID)) 10507 if (!UUID.TryParse(name, out assetID))
10510 { 10508 {
10511 foreach (TaskInventoryItem item in itemsDictionary.Values) 10509 TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name);
10512 { 10510
10513 if (item.Type == 7 && item.Name == name) 10511 if (item != null && item.Type == 7)
10514 { 10512 assetID = item.AssetID;
10515 assetID = item.AssetID;
10516 break;
10517 }
10518 }
10519 } 10513 }
10520 10514
10521 if (assetID == UUID.Zero) 10515 if (assetID == UUID.Zero)