aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs46
2 files changed, 30 insertions, 19 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index c7b38a1..eb5c3cb 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3211,8 +3211,6 @@ namespace OpenSim.Region.Framework.Scenes
3211 m_eventManager.TriggerOnRemovePresence(agentID); 3211 m_eventManager.TriggerOnRemovePresence(agentID);
3212 m_log.Debug("[Scene] Finished OnRemovePresence"); 3212 m_log.Debug("[Scene] Finished OnRemovePresence");
3213 3213
3214 CleanDroppedAttachments();
3215
3216 ForEachClient( 3214 ForEachClient(
3217 delegate(IClientAPI client) 3215 delegate(IClientAPI client)
3218 { 3216 {
@@ -3248,6 +3246,7 @@ namespace OpenSim.Region.Framework.Scenes
3248 } 3246 }
3249 m_log.Debug("[Scene] Done. Firing RemoveCircuit"); 3247 m_log.Debug("[Scene] Done. Firing RemoveCircuit");
3250 m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode); 3248 m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode);
3249 CleanDroppedAttachments();
3251 m_log.Debug("[Scene] The avatar has left the building"); 3250 m_log.Debug("[Scene] The avatar has left the building");
3252 //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)); 3251 //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false));
3253 //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true)); 3252 //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true));
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 94ec534..1268259 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -104,7 +104,6 @@ namespace OpenSim.Region.Framework.Scenes
104 104
105 protected internal Dictionary<uint, SceneObjectGroup> SceneObjectGroupsByLocalID = new Dictionary<uint, SceneObjectGroup>(); 105 protected internal Dictionary<uint, SceneObjectGroup> SceneObjectGroupsByLocalID = new Dictionary<uint, SceneObjectGroup>();
106 protected internal Dictionary<UUID, SceneObjectGroup> SceneObjectGroupsByFullID = new Dictionary<UUID, SceneObjectGroup>(); 106 protected internal Dictionary<UUID, SceneObjectGroup> SceneObjectGroupsByFullID = new Dictionary<UUID, SceneObjectGroup>();
107 private readonly Object m_dictionary_lock = new Object();
108 107
109 private Object m_updateLock = new Object(); 108 private Object m_updateLock = new Object();
110 109
@@ -150,11 +149,10 @@ namespace OpenSim.Region.Framework.Scenes
150 m_scenePresencesLock.ExitWriteLock(); 149 m_scenePresencesLock.ExitWriteLock();
151 } 150 }
152 151
153 lock (m_dictionary_lock) 152 lock (SceneObjectGroupsByFullID)
154 {
155 SceneObjectGroupsByFullID.Clear(); 153 SceneObjectGroupsByFullID.Clear();
154 lock (SceneObjectGroupsByLocalID)
156 SceneObjectGroupsByLocalID.Clear(); 155 SceneObjectGroupsByLocalID.Clear();
157 }
158 156
159 Entities.Clear(); 157 Entities.Clear();
160 } 158 }
@@ -385,15 +383,17 @@ namespace OpenSim.Region.Framework.Scenes
385 OnObjectCreate(sceneObject); 383 OnObjectCreate(sceneObject);
386 } 384 }
387 385
388 lock (m_dictionary_lock) 386 lock (SceneObjectGroupsByFullID)
389 { 387 {
390 SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject; 388 SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
391 SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject;
392 foreach (SceneObjectPart part in sceneObject.Children.Values) 389 foreach (SceneObjectPart part in sceneObject.Children.Values)
393 {
394 SceneObjectGroupsByFullID[part.UUID] = sceneObject; 390 SceneObjectGroupsByFullID[part.UUID] = sceneObject;
391 }
392 lock (SceneObjectGroupsByLocalID)
393 {
394 SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject;
395 foreach (SceneObjectPart part in sceneObject.Children.Values)
395 SceneObjectGroupsByLocalID[part.LocalId] = sceneObject; 396 SceneObjectGroupsByLocalID[part.LocalId] = sceneObject;
396 }
397 } 397 }
398 } 398 }
399 399
@@ -408,24 +408,32 @@ namespace OpenSim.Region.Framework.Scenes
408 { 408 {
409 if (Entities.ContainsKey(uuid)) 409 if (Entities.ContainsKey(uuid))
410 { 410 {
411 SceneObjectGroup grp = (SceneObjectGroup)Entities[uuid];
412
411 if (!resultOfObjectLinked) 413 if (!resultOfObjectLinked)
412 { 414 {
413 m_numPrim -= ((SceneObjectGroup) Entities[uuid]).Children.Count; 415 m_numPrim -= ((SceneObjectGroup) Entities[uuid]).Children.Count;
414 416
415 if ((((SceneObjectGroup)Entities[uuid]).RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics) 417 if ((grp.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics)
416 { 418 RemovePhysicalPrim(grp.Children.Count);
417 RemovePhysicalPrim(((SceneObjectGroup)Entities[uuid]).Children.Count);
418 }
419 } 419 }
420 420
421 if (OnObjectRemove != null) 421 if (OnObjectRemove != null)
422 OnObjectRemove(Entities[uuid]); 422 OnObjectRemove(Entities[uuid]);
423 423
424 lock (m_dictionary_lock) 424 lock (SceneObjectGroupsByFullID)
425 { 425 {
426 SceneObjectGroupsByFullID.Remove(uuid); 426 foreach (SceneObjectPart part in grp.Children.Values)
427 SceneObjectGroupsByLocalID.Remove(((SceneObjectGroup)Entities[uuid]).LocalId); 427 SceneObjectGroupsByFullID.Remove(part.UUID);
428 SceneObjectGroupsByFullID.Remove(grp.RootPart.UUID);
428 } 429 }
430 lock (SceneObjectGroupsByLocalID)
431 {
432 foreach (SceneObjectPart part in grp.Children.Values)
433 SceneObjectGroupsByLocalID.Remove(part.LocalId);
434 SceneObjectGroupsByLocalID.Remove(grp.RootPart.LocalId);
435 }
436
429 Entities.Remove(uuid); 437 Entities.Remove(uuid);
430 //SceneObjectGroup part; 438 //SceneObjectGroup part;
431 //((part.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics) 439 //((part.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics)
@@ -884,7 +892,9 @@ namespace OpenSim.Region.Framework.Scenes
884 { 892 {
885 if (SceneObjectGroupsByLocalID.TryGetValue(localID, out sog)) 893 if (SceneObjectGroupsByLocalID.TryGetValue(localID, out sog))
886 { 894 {
887 return sog; 895 if (sog.HasChildPrim(localID))
896 return sog;
897 SceneObjectGroupsByLocalID.Remove(localID);
888 } 898 }
889 } 899 }
890 900
@@ -920,7 +930,9 @@ namespace OpenSim.Region.Framework.Scenes
920 { 930 {
921 if (SceneObjectGroupsByFullID.TryGetValue(fullID, out sog)) 931 if (SceneObjectGroupsByFullID.TryGetValue(fullID, out sog))
922 { 932 {
923 return sog; 933 if (sog.Children.ContainsKey(fullID))
934 return sog;
935 SceneObjectGroupsByFullID.Remove(fullID);
924 } 936 }
925 } 937 }
926 938