From d54b6608a7acfa7fc9fd074f2fbd241519067fcb Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 17 Nov 2008 15:40:27 +0000 Subject: * Stop nulling SOG.m_rootPart and parts on object deletion * This renders RootPart == null checks useless - the replacement is to check SOG.IsDeleted. However, in many cases this will not be necessary since updates to deleted parts will not be sent to the client * This should remove any remaining race conditions where an object is deleted while another thread is yet to obtain the root part to perform some operation * Doing this is probably a necessary prerequisite to moving to a model without a separate SOG and SOP * Unfortunately it's not possible to eliminate all RootPart == null checks since in some contexts it is currently used to check whether an object was created successfully --- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs') diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index c91027c..935c51b 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -637,8 +637,10 @@ namespace OpenSim.Region.Environment.Scenes while (m_partsUpdateQueue.Count > 0) { SceneObjectPart part = m_partsUpdateQueue.Dequeue(); - if (part.ParentGroup == null || part.ParentGroup.RootPart == null) + + if (part.ParentGroup == null || part.ParentGroup.IsDeleted) continue; + if (m_updateTimes.ContainsKey(part.UUID)) { ScenePartUpdate update = m_updateTimes[part.UUID]; @@ -2582,10 +2584,8 @@ namespace OpenSim.Region.Environment.Scenes if (gobj == null) return false; - if (gobj.RootPart == null) - { + if (gobj.IsDeleted) return false; - } } } return true; @@ -2598,7 +2598,7 @@ namespace OpenSim.Region.Environment.Scenes // Validate foreach (SceneObjectGroup gobj in m_attachments) { - if (gobj == null || gobj.RootPart == null) + if (gobj == null || gobj.IsDeleted) return false; } -- cgit v1.1