aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-07-19 22:59:28 +0100
committerJustin Clark-Casey (justincc)2012-07-19 22:59:28 +0100
commite94831ddab282f2d84d0dad0b28e7cce6ac4c4b0 (patch)
treedcc956a3d6dc15069b6b22c0602b2b53d48c45a6
parentminor: remove some mono compiler warnings (diff)
downloadopensim-SC_OLD-e94831ddab282f2d84d0dad0b28e7cce6ac4c4b0.zip
opensim-SC_OLD-e94831ddab282f2d84d0dad0b28e7cce6ac4c4b0.tar.gz
opensim-SC_OLD-e94831ddab282f2d84d0dad0b28e7cce6ac4c4b0.tar.bz2
opensim-SC_OLD-e94831ddab282f2d84d0dad0b28e7cce6ac4c4b0.tar.xz
Stop explicitly closing and nulling out Animator in order to prevent NREs in various places due to race conditions.
Even where checks are being made they aren't enough since they all assume that the Animator they just checked is still there in the next line, which is not necessarily the case without locking. The memory used is small and these should be GC'd anyway when the SP is released. If this is not happening then the wider problem of old SPs being retained needs to be resolved.
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs22
2 files changed, 7 insertions, 23 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index 14ae287..ff53f45 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -535,11 +535,5 @@ namespace OpenSim.Region.Framework.Scenes.Animation
535 535
536 SendAnimPack(animIDs, sequenceNums, objectIDs); 536 SendAnimPack(animIDs, sequenceNums, objectIDs);
537 } 537 }
538
539 public void Close()
540 {
541 m_animations = null;
542 m_scenePresence = null;
543 }
544 } 538 }
545} 539} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 0e7f2e5..548dfd3 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -109,15 +109,10 @@ namespace OpenSim.Region.Framework.Scenes
109 109
110 public UUID currentParcelUUID = UUID.Zero; 110 public UUID currentParcelUUID = UUID.Zero;
111 111
112 protected ScenePresenceAnimator m_animator;
113 /// <value> 112 /// <value>
114 /// The animator for this avatar 113 /// The animator for this avatar
115 /// </value> 114 /// </value>
116 public ScenePresenceAnimator Animator 115 public ScenePresenceAnimator Animator { get; private set; }
117 {
118 get { return m_animator; }
119 private set { m_animator = value; }
120 }
121 116
122 /// <summary> 117 /// <summary>
123 /// Attachments recorded on this avatar. 118 /// Attachments recorded on this avatar.
@@ -2569,8 +2564,7 @@ namespace OpenSim.Region.Framework.Scenes
2569 //m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAgent from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID); 2564 //m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAgent from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID);
2570 2565
2571 avatar.ControllingClient.SendAvatarDataImmediate(this); 2566 avatar.ControllingClient.SendAvatarDataImmediate(this);
2572 if (Animator != null) 2567 Animator.SendAnimPackToClient(avatar.ControllingClient);
2573 Animator.SendAnimPackToClient(avatar.ControllingClient);
2574 } 2568 }
2575 2569
2576 /// <summary> 2570 /// <summary>
@@ -3239,14 +3233,12 @@ namespace OpenSim.Region.Framework.Scenes
3239 //if ((Math.Abs(Velocity.X) > 0.1e-9f) || (Math.Abs(Velocity.Y) > 0.1e-9f)) 3233 //if ((Math.Abs(Velocity.X) > 0.1e-9f) || (Math.Abs(Velocity.Y) > 0.1e-9f))
3240 // The Physics Scene will send updates every 500 ms grep: PhysicsActor.SubscribeEvents( 3234 // The Physics Scene will send updates every 500 ms grep: PhysicsActor.SubscribeEvents(
3241 // as of this comment the interval is set in AddToPhysicalScene 3235 // as of this comment the interval is set in AddToPhysicalScene
3242 if (Animator != null) 3236
3243 {
3244// if (m_updateCount > 0) 3237// if (m_updateCount > 0)
3245// { 3238// {
3246 Animator.UpdateMovementAnimations(); 3239 Animator.UpdateMovementAnimations();
3247// m_updateCount--; 3240// m_updateCount--;
3248// } 3241// }
3249 }
3250 3242
3251 CollisionEventUpdate collisionData = (CollisionEventUpdate)e; 3243 CollisionEventUpdate collisionData = (CollisionEventUpdate)e;
3252 Dictionary<uint, ContactPoint> coldata = collisionData.m_objCollisionList; 3244 Dictionary<uint, ContactPoint> coldata = collisionData.m_objCollisionList;
@@ -3261,7 +3253,7 @@ namespace OpenSim.Region.Framework.Scenes
3261// m_lastColCount = coldata.Count; 3253// m_lastColCount = coldata.Count;
3262// } 3254// }
3263 3255
3264 if (coldata.Count != 0 && Animator != null) 3256 if (coldata.Count != 0)
3265 { 3257 {
3266 switch (Animator.CurrentMovementAnimation) 3258 switch (Animator.CurrentMovementAnimation)
3267 { 3259 {
@@ -3371,7 +3363,7 @@ namespace OpenSim.Region.Framework.Scenes
3371 ControllingClient.SendHealth(Health); 3363 ControllingClient.SendHealth(Health);
3372 } 3364 }
3373 3365
3374 public void Close() 3366 protected internal void Close()
3375 { 3367 {
3376 // Clear known regions 3368 // Clear known regions
3377 KnownRegions = new Dictionary<ulong, string>(); 3369 KnownRegions = new Dictionary<ulong, string>();
@@ -3387,8 +3379,6 @@ namespace OpenSim.Region.Framework.Scenes
3387 // m_reprioritizationTimer.Dispose(); 3379 // m_reprioritizationTimer.Dispose();
3388 3380
3389 RemoveFromPhysicalScene(); 3381 RemoveFromPhysicalScene();
3390 Animator.Close();
3391 Animator = null;
3392 } 3382 }
3393 3383
3394 public void AddAttachment(SceneObjectGroup gobj) 3384 public void AddAttachment(SceneObjectGroup gobj)