diff options
author | Justin Clark-Casey (justincc) | 2012-07-04 22:00:39 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-04 22:00:39 +0100 |
commit | 2f998fce1f51e9991852144c940281fedffbbbca (patch) | |
tree | 59fe2c7c66565eb68e82cd2b6c360847e20b6c87 /OpenSim/Region | |
parent | refactor: In llGetNumberOfNotecardLines() use existing GetInventoryItem() rat... (diff) | |
download | opensim-SC_OLD-2f998fce1f51e9991852144c940281fedffbbbca.zip opensim-SC_OLD-2f998fce1f51e9991852144c940281fedffbbbca.tar.gz opensim-SC_OLD-2f998fce1f51e9991852144c940281fedffbbbca.tar.bz2 opensim-SC_OLD-2f998fce1f51e9991852144c940281fedffbbbca.tar.xz |
refactor: In llGetNotecardLine() use existing GetInventoryItem() rather than inspecting a clone of the TaskInventory dictionary that was not cloned thread-safe
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 14 |
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 2b8c4c1..cf65abb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -10558,20 +10558,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10558 | { | 10558 | { |
10559 | m_host.AddScriptLPS(1); | 10559 | m_host.AddScriptLPS(1); |
10560 | 10560 | ||
10561 | TaskInventoryDictionary itemsDictionary = (TaskInventoryDictionary)m_host.TaskInventory.Clone(); | ||
10562 | |||
10563 | UUID assetID = UUID.Zero; | 10561 | UUID assetID = UUID.Zero; |
10564 | 10562 | ||
10565 | if (!UUID.TryParse(name, out assetID)) | 10563 | if (!UUID.TryParse(name, out assetID)) |
10566 | { | 10564 | { |
10567 | foreach (TaskInventoryItem item in itemsDictionary.Values) | 10565 | TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name); |
10568 | { | 10566 | |
10569 | if (item.Type == 7 && item.Name == name) | 10567 | if (item != null && item.Type == 7) |
10570 | { | 10568 | assetID = item.AssetID; |
10571 | assetID = item.AssetID; | ||
10572 | break; | ||
10573 | } | ||
10574 | } | ||
10575 | } | 10569 | } |
10576 | 10570 | ||
10577 | if (assetID == UUID.Zero) | 10571 | if (assetID == UUID.Zero) |