diff options
author | Justin Clark-Casey (justincc) | 2011-09-09 01:00:41 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-09-09 19:55:30 +0100 |
commit | 655935db49ad3a363426eef52f4aedba990cc9af (patch) | |
tree | 155916b0273239dab5892fda134349820247345b | |
parent | Fix unit tests from RegionSettings commit (diff) | |
download | opensim-SC_OLD-655935db49ad3a363426eef52f4aedba990cc9af.zip opensim-SC_OLD-655935db49ad3a363426eef52f4aedba990cc9af.tar.gz opensim-SC_OLD-655935db49ad3a363426eef52f4aedba990cc9af.tar.bz2 opensim-SC_OLD-655935db49ad3a363426eef52f4aedba990cc9af.tar.xz |
Use a copy of the inventory items list to register users in the thread started by GetFolderContent(), to protect ourselves against callers modifying lists
Hopefully this addresses http://opensimulator.org/mantis/view.php?id=5681
2 files changed, 8 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index d3ef08d..1c83f8e 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -188,8 +188,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
188 | Util.FireAndForget(delegate | 188 | Util.FireAndForget(delegate |
189 | { | 189 | { |
190 | if (UserManager != null) | 190 | if (UserManager != null) |
191 | foreach (InventoryItemBase item in invCol.Items) | 191 | { |
192 | // Protect ourselves against the caller subsequently modifying the items list | ||
193 | foreach (InventoryItemBase item in new List<InventoryItemBase>(invCol.Items)) | ||
192 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); | 194 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); |
195 | } | ||
193 | }); | 196 | }); |
194 | 197 | ||
195 | return invCol; | 198 | return invCol; |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs index eb90774..c9c716c 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs | |||
@@ -196,8 +196,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
196 | Util.FireAndForget(delegate | 196 | Util.FireAndForget(delegate |
197 | { | 197 | { |
198 | if (UserManager != null) | 198 | if (UserManager != null) |
199 | foreach (InventoryItemBase item in invCol.Items) | 199 | { |
200 | // Protect ourselves against the caller subsequently modifying the items list | ||
201 | foreach (InventoryItemBase item in new List<InventoryItemBase>(invCol.Items)) | ||
200 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); | 202 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); |
203 | } | ||
201 | }); | 204 | }); |
202 | 205 | ||
203 | return invCol; | 206 | return invCol; |