aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authormeta72010-08-10 09:50:18 -0700
committermeta72010-08-10 09:50:18 -0700
commit48c52d6e4868640ac87fc748ac9ac533051a1e62 (patch)
tree161b08a853d614858ffd031f48eeaa0cb685218d
parentNote to self: don't break the build (diff)
downloadopensim-SC-48c52d6e4868640ac87fc748ac9ac533051a1e62.zip
opensim-SC-48c52d6e4868640ac87fc748ac9ac533051a1e62.tar.gz
opensim-SC-48c52d6e4868640ac87fc748ac9ac533051a1e62.tar.bz2
opensim-SC-48c52d6e4868640ac87fc748ac9ac533051a1e62.tar.xz
Fix a dangling lock issue in llRemoveInventory
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs26
1 files changed, 15 insertions, 11 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 71d63bb..1486e2a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4200,21 +4200,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4200 { 4200 {
4201 m_host.AddScriptLPS(1); 4201 m_host.AddScriptLPS(1);
4202 4202
4203 m_host.TaskInventory.LockItemsForRead(true); 4203 try
4204 foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
4205 { 4204 {
4206 if (item.Name == name) 4205 m_host.TaskInventory.LockItemsForRead(true);
4206 foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
4207 { 4207 {
4208 if (item.ItemID == m_itemID) 4208 if (item.Name == name)
4209 throw new ScriptDeleteException(); 4209 {
4210 else 4210 if (item.ItemID == m_itemID)
4211 m_host.Inventory.RemoveInventoryItem(item.ItemID); 4211 throw new ScriptDeleteException();
4212 4212 else
4213 m_host.TaskInventory.LockItemsForRead(false); 4213 m_host.Inventory.RemoveInventoryItem(item.ItemID);
4214 return; 4214 return;
4215 }
4215 } 4216 }
4216 } 4217 }
4217 m_host.TaskInventory.LockItemsForRead(false); 4218 finally
4219 {
4220 m_host.TaskInventory.LockItemsForRead(false);
4221 }
4218 } 4222 }
4219 4223
4220 public void llSetText(string text, LSL_Vector color, double alpha) 4224 public void llSetText(string text, LSL_Vector color, double alpha)