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/Scene.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index c055160..cf743de 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -2015,7 +2015,7 @@ namespace OpenSim.Region.Environment.Scenes { if (grp == null) return; - if (grp.RootPart == null) + if (grp.IsDeleted) return; if (grp.RootPart.DIE_AT_EDGE) @@ -2116,7 +2116,7 @@ namespace OpenSim.Region.Environment.Scenes } else { - if (grp.RootPart != null) + if (!grp.IsDeleted) { if (grp.RootPart.PhysActor != null) { @@ -2688,7 +2688,7 @@ namespace OpenSim.Region.Environment.Scenes SceneObjectPart part = GetSceneObjectPart(localID); if (part != null) // It is a prim { - if (part.ParentGroup != null && part.ParentGroup.RootPart != null) // Valid + if (part.ParentGroup != null && !part.ParentGroup.IsDeleted) // Valid { if (part.ParentGroup.RootPart != part) // Child part return; @@ -4200,7 +4200,7 @@ namespace OpenSim.Region.Environment.Scenes if (part == null || part.ParentGroup == null) return; - if (part.ParentGroup.RootPart == null) + if (part.ParentGroup.IsDeleted) return; part = part.ParentGroup.RootPart; @@ -4366,7 +4366,7 @@ namespace OpenSim.Region.Environment.Scenes { SceneObjectGroup grp = (SceneObjectGroup)obj; - if (grp.RootPart != null) + if (!grp.IsDeleted) { if ((grp.RootPart.Flags & PrimFlags.TemporaryOnRez) != 0) { -- cgit v1.1