diff options
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index 5a06bdb..65ce13a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs | |||
@@ -46,12 +46,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
46 | /// </summary> | 46 | /// </summary> |
47 | public void ForceInventoryPersistence() | 47 | public void ForceInventoryPersistence() |
48 | { | 48 | { |
49 | lock (m_parts) | 49 | lockPartsForRead(true); |
50 | List<SceneObjectPart> values = new List<SceneObjectPart>(m_parts.Values); | ||
51 | lockPartsForRead(false); | ||
52 | foreach (SceneObjectPart part in values) | ||
50 | { | 53 | { |
51 | foreach (SceneObjectPart part in m_parts.Values) | 54 | part.Inventory.ForceInventoryPersistence(); |
52 | { | ||
53 | part.Inventory.ForceInventoryPersistence(); | ||
54 | } | ||
55 | } | 55 | } |
56 | } | 56 | } |
57 | 57 | ||
@@ -75,14 +75,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
75 | /// Stop the scripts contained in all the prims in this group | 75 | /// Stop the scripts contained in all the prims in this group |
76 | /// </summary> | 76 | /// </summary> |
77 | public void RemoveScriptInstances() | 77 | public void RemoveScriptInstances() |
78 | { | 78 | { |
79 | lock (m_parts) | 79 | lockPartsForRead(true); |
80 | List<SceneObjectPart> values = new List<SceneObjectPart>(m_parts.Values); | ||
81 | lockPartsForRead(false); | ||
82 | |||
83 | foreach (SceneObjectPart part in values) | ||
80 | { | 84 | { |
81 | foreach (SceneObjectPart part in m_parts.Values) | 85 | part.Inventory.RemoveScriptInstances(); |
82 | { | ||
83 | part.Inventory.RemoveScriptInstances(); | ||
84 | } | ||
85 | } | 86 | } |
87 | |||
86 | } | 88 | } |
87 | 89 | ||
88 | /// <summary> | 90 | /// <summary> |