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.Inventory.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs') diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 9ad8382..cc8501d 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -1552,7 +1552,7 @@ namespace OpenSim.Region.Environment.Scenes if (part == null) return; - if (part.ParentGroup == null || part.ParentGroup.RootPart == null) + if (part.ParentGroup == null || part.ParentGroup.IsDeleted) return; // Can't delete child prims @@ -2379,7 +2379,7 @@ namespace OpenSim.Region.Environment.Scenes public UUID RezSingleAttachment(SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt) { - if (att.RootPart != null) + if (!att.IsDeleted) AttachmentPt = att.RootPart.AttachmentPoint; ScenePresence presence; -- cgit v1.1