no need to clone something Idisposable when we just want to see values

master
UbitUmarov 2020-05-12 18:58:07 +01:00
parent d613287a77
commit 51bc19f1ab
2 changed files with 5 additions and 12 deletions

View File

@ -267,12 +267,8 @@ namespace OpenSim.Framework
public List<TaskInventoryItem> GetItems() public List<TaskInventoryItem> GetItems()
{ {
var ret = new List<TaskInventoryItem>(this.Count);
m_itemLock.EnterReadLock(); m_itemLock.EnterReadLock();
foreach (TaskInventoryItem it in Values) var ret = new List<TaskInventoryItem>(Values);
{
ret.Add(it);
}
m_itemLock.ExitReadLock(); m_itemLock.ExitReadLock();
return ret; return ret;
} }

View File

@ -397,14 +397,12 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
TaskInventoryDictionary taskDictionary = (TaskInventoryDictionary)part.TaskInventory.Clone(); List<TaskInventoryItem> items = part.TaskInventory.GetItems();
// Now analyze this prim's inventory items to preserve all the uuids that they reference // Now analyze this prim's inventory items to preserve all the uuids that they reference
foreach (TaskInventoryItem tii in taskDictionary.Values) for(i = 0; i < items.Count; ++i)
{ {
// m_log.DebugFormat( TaskInventoryItem tii = items[i];
// "[ARCHIVER]: Analysing item {0} asset type {1} in {2} {3}", items[i] = null; // gc is stupid
// tii.Name, tii.Type, part.Name, part.UUID);
AddForInspection(tii.AssetID, (sbyte)tii.Type); AddForInspection(tii.AssetID, (sbyte)tii.Type);
} }
@ -414,7 +412,6 @@ namespace OpenSim.Region.Framework.Scenes
// Scene.EventManager is present. // Scene.EventManager is present.
// part.ParentGroup.Scene.EventManager.TriggerGatherUuids(part, assetUuids); // part.ParentGroup.Scene.EventManager.TriggerGatherUuids(part, assetUuids);
// still needed to retrieve textures used as materials for any parts containing legacy materials stored in DynAttrs // still needed to retrieve textures used as materials for any parts containing legacy materials stored in DynAttrs
RecordMaterialsUuids(part); RecordMaterialsUuids(part);
} }