aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie Thielker2010-08-25 16:06:06 +0200
committerMelanie Thielker2010-08-25 16:06:06 +0200
commit314d1171efd6d45686ad54944e9bf53ec8cd0b7f (patch)
tree805af4de336bdf5f5286dea18b49f971a160208a /OpenSim
parentMerge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/va... (diff)
downloadopensim-SC_OLD-314d1171efd6d45686ad54944e9bf53ec8cd0b7f.zip
opensim-SC_OLD-314d1171efd6d45686ad54944e9bf53ec8cd0b7f.tar.gz
opensim-SC_OLD-314d1171efd6d45686ad54944e9bf53ec8cd0b7f.tar.bz2
opensim-SC_OLD-314d1171efd6d45686ad54944e9bf53ec8cd0b7f.tar.xz
Lock the attachment cleanup so it doesn't go into an endless deletion frenzy
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs36
1 files changed, 20 insertions, 16 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 37d797e..2324f7a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -399,6 +399,7 @@ namespace OpenSim.Region.Framework.Scenes
399 private bool m_firstHeartbeat = true; 399 private bool m_firstHeartbeat = true;
400 400
401 private object m_deleting_scene_object = new object(); 401 private object m_deleting_scene_object = new object();
402 private object m_cleaningAttachments = new object();
402 403
403 // the minimum time that must elapse before a changed object will be considered for persisted 404 // the minimum time that must elapse before a changed object will be considered for persisted
404 public long m_dontPersistBefore = DEFAULT_MIN_TIME_FOR_PERSISTENCE * 10000000L; 405 public long m_dontPersistBefore = DEFAULT_MIN_TIME_FOR_PERSISTENCE * 10000000L;
@@ -5051,26 +5052,29 @@ namespace OpenSim.Region.Framework.Scenes
5051 List<SceneObjectGroup> objectsToDelete = 5052 List<SceneObjectGroup> objectsToDelete =
5052 new List<SceneObjectGroup>(); 5053 new List<SceneObjectGroup>();
5053 5054
5054 ForEachSOG(delegate (SceneObjectGroup grp) 5055 lock (m_cleaningAttachments)
5055 { 5056 {
5056 if (grp.RootPart.Shape.State != 0) 5057 ForEachSOG(delegate (SceneObjectGroup grp)
5057 { 5058 {
5058 UUID agentID = grp.OwnerID; 5059 if (grp.RootPart.Shape.State != 0 || objectsToDelete.Contains(grp))
5059 if (agentID == UUID.Zero)
5060 { 5060 {
5061 objectsToDelete.Add(grp); 5061 UUID agentID = grp.OwnerID;
5062 return; 5062 if (agentID == UUID.Zero)
5063 {
5064 objectsToDelete.Add(grp);
5065 return;
5066 }
5067
5068 ScenePresence sp = GetScenePresence(agentID);
5069 if (sp == null)
5070 {
5071 objectsToDelete.Add(grp);
5072 return;
5073 }
5063 } 5074 }
5075 });
5076 }
5064 5077
5065 ScenePresence sp = GetScenePresence(agentID);
5066 if (sp == null)
5067 {
5068 objectsToDelete.Add(grp);
5069 return;
5070 }
5071 }
5072 });
5073
5074 foreach (SceneObjectGroup grp in objectsToDelete) 5078 foreach (SceneObjectGroup grp in objectsToDelete)
5075 { 5079 {
5076 m_log.InfoFormat("[SCENE]: Deleting dropped attachment {0} of user {1}", grp.UUID, grp.OwnerID); 5080 m_log.InfoFormat("[SCENE]: Deleting dropped attachment {0} of user {1}", grp.UUID, grp.OwnerID);