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
remove-scene-viewer
Justin Clark-Casey (justincc) 2011-09-09 01:00:41 +01:00
parent 42790f021f
commit 655935db49
2 changed files with 8 additions and 2 deletions

View File

@ -188,8 +188,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
Util.FireAndForget(delegate
{
if (UserManager != null)
foreach (InventoryItemBase item in invCol.Items)
{
// Protect ourselves against the caller subsequently modifying the items list
foreach (InventoryItemBase item in new List<InventoryItemBase>(invCol.Items))
UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData);
}
});
return invCol;

View File

@ -196,8 +196,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
Util.FireAndForget(delegate
{
if (UserManager != null)
foreach (InventoryItemBase item in invCol.Items)
{
// Protect ourselves against the caller subsequently modifying the items list
foreach (InventoryItemBase item in new List<InventoryItemBase>(invCol.Items))
UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData);
}
});
return invCol;