diff options
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 3576a88..94a773d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -174,6 +174,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
174 | private bool m_firstHeartbeat = true; | 174 | private bool m_firstHeartbeat = true; |
175 | 175 | ||
176 | private object m_deleting_scene_object = new object(); | 176 | private object m_deleting_scene_object = new object(); |
177 | private object m_cleaningAttachments = new object(); | ||
177 | 178 | ||
178 | private UpdatePrioritizationSchemes m_priorityScheme = UpdatePrioritizationSchemes.Time; | 179 | private UpdatePrioritizationSchemes m_priorityScheme = UpdatePrioritizationSchemes.Time; |
179 | private bool m_reprioritizationEnabled = true; | 180 | private bool m_reprioritizationEnabled = true; |
@@ -3163,8 +3164,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3163 | 3164 | ||
3164 | m_eventManager.TriggerOnRemovePresence(agentID); | 3165 | m_eventManager.TriggerOnRemovePresence(agentID); |
3165 | 3166 | ||
3166 | CleanDroppedAttachments(); | ||
3167 | |||
3168 | ForEachClient( | 3167 | ForEachClient( |
3169 | delegate(IClientAPI client) | 3168 | delegate(IClientAPI client) |
3170 | { | 3169 | { |
@@ -3197,6 +3196,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3197 | } | 3196 | } |
3198 | 3197 | ||
3199 | m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode); | 3198 | m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode); |
3199 | CleanDroppedAttachments(); | ||
3200 | //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)); | 3200 | //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)); |
3201 | //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true)); | 3201 | //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true)); |
3202 | } | 3202 | } |
@@ -4995,25 +4995,29 @@ namespace OpenSim.Region.Framework.Scenes | |||
4995 | List<SceneObjectGroup> objectsToDelete = | 4995 | List<SceneObjectGroup> objectsToDelete = |
4996 | new List<SceneObjectGroup>(); | 4996 | new List<SceneObjectGroup>(); |
4997 | 4997 | ||
4998 | ForEachSOG(delegate (SceneObjectGroup grp) | 4998 | lock (m_cleaningAttachments) |
4999 | { | 4999 | { |
5000 | if (grp.RootPart.Shape.State != 0) | 5000 | ForEachSOG(delegate (SceneObjectGroup grp) |
5001 | { | 5001 | { |
5002 | if (grp.RootPart.Shape.PCode == 0 && grp.RootPart.Shape.State != 0 && (!objectsToDelete.Contains(grp))) | 5002 | if (grp.RootPart.Shape.PCode == 0 && grp.RootPart.Shape.State != 0 && (!objectsToDelete.Contains(grp))) |
5003 | { | 5003 | { |
5004 | objectsToDelete.Add(grp); | 5004 | UUID agentID = grp.OwnerID; |
5005 | return; | 5005 | if (agentID == UUID.Zero) |
5006 | { | ||
5007 | objectsToDelete.Add(grp); | ||
5008 | return; | ||
5009 | } | ||
5010 | |||
5011 | ScenePresence sp = GetScenePresence(agentID); | ||
5012 | if (sp == null) | ||
5013 | { | ||
5014 | objectsToDelete.Add(grp); | ||
5015 | return; | ||
5016 | } | ||
5006 | } | 5017 | } |
5018 | }); | ||
5019 | } | ||
5007 | 5020 | ||
5008 | ScenePresence sp = GetScenePresence(agentID); | ||
5009 | if (sp == null) | ||
5010 | { | ||
5011 | objectsToDelete.Add(grp); | ||
5012 | return; | ||
5013 | } | ||
5014 | } | ||
5015 | }); | ||
5016 | |||
5017 | foreach (SceneObjectGroup grp in objectsToDelete) | 5021 | foreach (SceneObjectGroup grp in objectsToDelete) |
5018 | { | 5022 | { |
5019 | m_log.InfoFormat("[SCENE]: Deleting dropped attachment {0} of user {1}", grp.UUID, grp.OwnerID); | 5023 | m_log.InfoFormat("[SCENE]: Deleting dropped attachment {0} of user {1}", grp.UUID, grp.OwnerID); |