aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-08-26 00:35:03 +0100
committerJustin Clark-Casey (justincc)2010-08-26 00:35:03 +0100
commit87a6554d4b10ebde08de91e10d050a2c7343b865 (patch)
treebeb5333563ee8d0ff0604b0c7879eb7350193c61 /OpenSim/Region/Framework/Scenes
parentRemove parts locking from data classes since these are using a copy of the sc... (diff)
parentPrevent an object disposed exception that made forms comms unreliable. After (diff)
downloadopensim-SC_OLD-87a6554d4b10ebde08de91e10d050a2c7343b865.zip
opensim-SC_OLD-87a6554d4b10ebde08de91e10d050a2c7343b865.tar.gz
opensim-SC_OLD-87a6554d4b10ebde08de91e10d050a2c7343b865.tar.bz2
opensim-SC_OLD-87a6554d4b10ebde08de91e10d050a2c7343b865.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Resolve merge conflicts Conflicts: OpenSim/Region/Framework/Scenes/SceneGraph.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs64
2 files changed, 38 insertions, 27 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 8556105..1f4d022 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3164,7 +3164,6 @@ namespace OpenSim.Region.Framework.Scenes
3164 } 3164 }
3165 3165
3166 m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode); 3166 m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode);
3167
3168 //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)); 3167 //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false));
3169 //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true)); 3168 //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true));
3170 } 3169 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 2b24706..1da4287 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -95,7 +95,6 @@ namespace OpenSim.Region.Framework.Scenes
95 95
96 protected internal Dictionary<uint, SceneObjectGroup> SceneObjectGroupsByLocalID = new Dictionary<uint, SceneObjectGroup>(); 96 protected internal Dictionary<uint, SceneObjectGroup> SceneObjectGroupsByLocalID = new Dictionary<uint, SceneObjectGroup>();
97 protected internal Dictionary<UUID, SceneObjectGroup> SceneObjectGroupsByFullID = new Dictionary<UUID, SceneObjectGroup>(); 97 protected internal Dictionary<UUID, SceneObjectGroup> SceneObjectGroupsByFullID = new Dictionary<UUID, SceneObjectGroup>();
98 private readonly Object m_dictionary_lock = new Object();
99 98
100 private Object m_updateLock = new Object(); 99 private Object m_updateLock = new Object();
101 100
@@ -136,11 +135,10 @@ namespace OpenSim.Region.Framework.Scenes
136 m_scenePresenceArray = newlist; 135 m_scenePresenceArray = newlist;
137 } 136 }
138 137
139 lock (m_dictionary_lock) 138 lock (SceneObjectGroupsByFullID)
140 {
141 SceneObjectGroupsByFullID.Clear(); 139 SceneObjectGroupsByFullID.Clear();
140 lock (SceneObjectGroupsByLocalID)
142 SceneObjectGroupsByLocalID.Clear(); 141 SceneObjectGroupsByLocalID.Clear();
143 }
144 142
145 Entities.Clear(); 143 Entities.Clear();
146 } 144 }
@@ -384,10 +382,10 @@ namespace OpenSim.Region.Framework.Scenes
384 } 382 }
385 383
386 sceneObject.AttachToScene(m_parentScene); 384 sceneObject.AttachToScene(m_parentScene);
387 385
388 if (sendClientUpdates) 386 if (sendClientUpdates)
389 sceneObject.ScheduleGroupForFullUpdate(); 387 sceneObject.ScheduleGroupForFullUpdate();
390 388
391 Entities.Add(sceneObject); 389 Entities.Add(sceneObject);
392 m_numPrim += sceneObject.Children.Count; 390 m_numPrim += sceneObject.Children.Count;
393 391
@@ -397,15 +395,18 @@ namespace OpenSim.Region.Framework.Scenes
397 if (OnObjectCreate != null) 395 if (OnObjectCreate != null)
398 OnObjectCreate(sceneObject); 396 OnObjectCreate(sceneObject);
399 397
400 lock (m_dictionary_lock) 398 lock (SceneObjectGroupsByFullID)
401 { 399 {
402 SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject; 400 SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
403 SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject;
404 foreach (SceneObjectPart part in sceneObject.Children.Values) 401 foreach (SceneObjectPart part in sceneObject.Children.Values)
405 {
406 SceneObjectGroupsByFullID[part.UUID] = sceneObject; 402 SceneObjectGroupsByFullID[part.UUID] = sceneObject;
403 }
404
405 lock (SceneObjectGroupsByLocalID)
406 {
407 SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject;
408 foreach (SceneObjectPart part in sceneObject.Children.Values)
407 SceneObjectGroupsByLocalID[part.LocalId] = sceneObject; 409 SceneObjectGroupsByLocalID[part.LocalId] = sceneObject;
408 }
409 } 410 }
410 } 411 }
411 } 412 }
@@ -421,29 +422,32 @@ namespace OpenSim.Region.Framework.Scenes
421 { 422 {
422 if (Entities.ContainsKey(uuid)) 423 if (Entities.ContainsKey(uuid))
423 { 424 {
425 SceneObjectGroup grp = (SceneObjectGroup)Entities[uuid];
426
424 if (!resultOfObjectLinked) 427 if (!resultOfObjectLinked)
425 { 428 {
426 SceneObjectGroup sog = Entities[uuid] as SceneObjectGroup; 429 m_numPrim -= grp.PrimCount;
427 430
428 lock (sog.Children) 431 if ((grp.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics)
429 { 432 RemovePhysicalPrim(grp.PrimCount);
430 m_numPrim -= sog.PrimCount;
431
432 if ((((SceneObjectGroup)Entities[uuid]).RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics)
433 {
434 RemovePhysicalPrim(sog.PrimCount);
435 }
436 }
437 } 433 }
438 434
439 if (OnObjectRemove != null) 435 if (OnObjectRemove != null)
440 OnObjectRemove(Entities[uuid]); 436 OnObjectRemove(Entities[uuid]);
441 437
442 lock (m_dictionary_lock) 438 lock (SceneObjectGroupsByFullID)
443 { 439 {
444 SceneObjectGroupsByFullID.Remove(uuid); 440 foreach (SceneObjectPart part in grp.Children.Values)
445 SceneObjectGroupsByLocalID.Remove(((SceneObjectGroup)Entities[uuid]).LocalId); 441 SceneObjectGroupsByFullID.Remove(part.UUID);
442 SceneObjectGroupsByFullID.Remove(grp.RootPart.UUID);
446 } 443 }
444 lock (SceneObjectGroupsByLocalID)
445 {
446 foreach (SceneObjectPart part in grp.Children.Values)
447 SceneObjectGroupsByLocalID.Remove(part.LocalId);
448 SceneObjectGroupsByLocalID.Remove(grp.RootPart.LocalId);
449 }
450
447 Entities.Remove(uuid); 451 Entities.Remove(uuid);
448 //SceneObjectGroup part; 452 //SceneObjectGroup part;
449 //((part.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics) 453 //((part.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics)
@@ -868,7 +872,9 @@ namespace OpenSim.Region.Framework.Scenes
868 { 872 {
869 if (SceneObjectGroupsByLocalID.TryGetValue(localID, out sog)) 873 if (SceneObjectGroupsByLocalID.TryGetValue(localID, out sog))
870 { 874 {
871 return sog; 875 if (sog.HasChildPrim(localID))
876 return sog;
877 SceneObjectGroupsByLocalID.Remove(localID);
872 } 878 }
873 } 879 }
874 880
@@ -904,7 +910,13 @@ namespace OpenSim.Region.Framework.Scenes
904 { 910 {
905 if (SceneObjectGroupsByFullID.TryGetValue(fullID, out sog)) 911 if (SceneObjectGroupsByFullID.TryGetValue(fullID, out sog))
906 { 912 {
907 return sog; 913 lock (sog.Children)
914 {
915 if (sog.Children.ContainsKey(fullID))
916 return sog;
917 }
918
919 SceneObjectGroupsByFullID.Remove(fullID);
908 } 920 }
909 } 921 }
910 922