diff options
author | Justin Clark-Casey (justincc) | 2012-07-04 21:19:16 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-04 21:19:16 +0100 |
commit | 3769739ca75bd28a126034a74848012164db31b6 (patch) | |
tree | 17e007fd125e1b261941bb7d77354ce7283a2468 | |
parent | refactor: In llCollisionSound() use existing GetInventoryItem() method rather... (diff) | |
download | opensim-SC_OLD-3769739ca75bd28a126034a74848012164db31b6.zip opensim-SC_OLD-3769739ca75bd28a126034a74848012164db31b6.tar.gz opensim-SC_OLD-3769739ca75bd28a126034a74848012164db31b6.tar.bz2 opensim-SC_OLD-3769739ca75bd28a126034a74848012164db31b6.tar.xz |
In llRequestInventoryData() use GetInventoryItems() rather than cloning TaskInventory directory
GetInventoryItems() returns a new list and so is equivalent, and creates this list under lock whereas Clone() is not thread-safe
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ff4b690..66d99a2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4084,9 +4084,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4084 | { | 4084 | { |
4085 | m_host.AddScriptLPS(1); | 4085 | m_host.AddScriptLPS(1); |
4086 | 4086 | ||
4087 | TaskInventoryDictionary itemDictionary = (TaskInventoryDictionary)m_host.TaskInventory.Clone(); | 4087 | foreach (TaskInventoryItem item in m_host.Inventory.GetInventoryItems()) |
4088 | |||
4089 | foreach (TaskInventoryItem item in itemDictionary.Values) | ||
4090 | { | 4088 | { |
4091 | if (item.Type == 3 && item.Name == name) | 4089 | if (item.Type == 3 && item.Name == name) |
4092 | { | 4090 | { |
@@ -4118,6 +4116,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4118 | return tid.ToString(); | 4116 | return tid.ToString(); |
4119 | } | 4117 | } |
4120 | } | 4118 | } |
4119 | |||
4121 | ScriptSleep(1000); | 4120 | ScriptSleep(1000); |
4122 | return String.Empty; | 4121 | return String.Empty; |
4123 | } | 4122 | } |