From 01878b886cdf2133a1bea37f683a427301f89f44 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Sat, 6 Sep 2008 00:44:50 +0000 Subject: * Fix mantis 2130 - nre occuring sometimes when the regular prim update sweep occurs * Fold m_deleted and m_isDeleted together (ugh!) --- OpenSim/Region/Environment/Scenes/InnerScene.cs | 3 ++- OpenSim/Region/Environment/Scenes/Scene.cs | 1 - .../Region/Environment/Scenes/SceneObjectGroup.cs | 22 +++++----------------- 3 files changed, 7 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 3fa1825d..6b002fc 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -142,7 +142,8 @@ namespace OpenSim.Region.Environment.Scenes foreach (EntityBase entity in updateEntities) { - entity.Update(); + if (!entity.IsDeleted) + entity.Update(); } } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 45062eb..becd7dc 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -760,7 +760,6 @@ namespace OpenSim.Region.Environment.Scenes if (m_frame % m_update_backup == 0) { UpdateStorageBackup(); - } if (m_frame % m_update_terrain == 0) diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index a86beae..7aa65c1 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -105,7 +105,6 @@ namespace OpenSim.Region.Environment.Scenes /// protected Dictionary m_parts = new Dictionary(); - private bool m_deleted = false; protected ulong m_regionHandle; protected SceneObjectPart m_rootPart; // private Dictionary m_scriptEvents = new Dictionary(); @@ -961,7 +960,9 @@ namespace OpenSim.Region.Environment.Scenes public void FakeDeleteGroup() { - m_deleted = true; + // If there are any updates queued for this object when the 'fake' delete happens, then make sure + // that they don't happen, otherwise the deleted objects will reappear + m_isDeleted = true; foreach (SceneObjectPart part in m_parts.Values) { @@ -1499,10 +1500,7 @@ namespace OpenSim.Region.Environment.Scenes //if (part.UpdateFlag == 0) part.UpdateFlag = 1; //} - - - checkAtTargets(); - + checkAtTargets(); if ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1) || (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1) @@ -1548,16 +1546,6 @@ namespace OpenSim.Region.Environment.Scenes /// public void ScheduleGroupForFullUpdate() { - // If we wre in the delete queue, this will be set - // A full update now would make the prim reappear - // after KillObject was sent via FakeDeleteGroup - // causing flickering and delays in deletion. - // This leads to users clicking delete multiple times - // which can crash the session. So, avoid it. - // - if (m_deleted) - return; - checkAtTargets(); lock (m_parts) { @@ -1572,7 +1560,7 @@ namespace OpenSim.Region.Environment.Scenes /// Schedule a terse update for this scene object /// public void ScheduleGroupForTerseUpdate() - { + { lock (m_parts) { foreach (SceneObjectPart part in m_parts.Values) -- cgit v1.1