From 03581c17e61dc7be91a364f40e5f2bcd0abb2fc7 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Sat, 6 Sep 2008 01:10:47 +0000 Subject: * refactor: Make SOG itself responsible for checking whether it's already been deleted on an update request from the regular sweep --- OpenSim/Region/Environment/Scenes/InnerScene.cs | 15 +++------------ OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 7 +++++++ 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 51ee4d0..658478d 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -141,9 +141,8 @@ namespace OpenSim.Region.Environment.Scenes List updateEntities = GetEntities(); foreach (EntityBase entity in updateEntities) - { - if (!entity.IsDeleted) - entity.Update(); + { + entity.Update(); } } @@ -327,15 +326,7 @@ namespace OpenSim.Region.Environment.Scenes // Don't abort the whole update if one entity happens to give us an exception. try { - // Check that the group was not deleted before the scheduled update - // FIXME: This is merely a temporary measure to reduce the incidence of failure, when - // an object has been deleted from a scene before update was processed. - // A more fundamental overhaul of the update mechanism is required to eliminate all - // the race conditions. - if (!entity.IsDeleted) - { - m_updateList[i].Update(); - } + m_updateList[i].Update(); } catch (Exception e) { diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 52b9bc1..b04e882 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -1478,6 +1478,13 @@ namespace OpenSim.Region.Environment.Scenes /// public override void Update() { + // Check that the group was not deleted before the scheduled update + // FIXME: This is merely a temporary measure to reduce the incidence of failure when + // an object has been deleted from a scene before update was processed. + // A more fundamental overhaul of the update mechanism is required to eliminate all + // the race conditions. + if (m_isDeleted) + return; lock (m_parts) { -- cgit v1.1