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/SceneObjectPart.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.cs') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index a02840c..74fa725 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -492,7 +492,7 @@ namespace OpenSim.Region.Environment.Scenes StoreUndoState(); m_offsetPosition = value; - if (ParentGroup != null && ParentGroup.RootPart != null) + if (ParentGroup != null && !ParentGroup.IsDeleted) { if (_parentID != 0 && PhysActor != null) { @@ -1326,7 +1326,7 @@ if (m_shape != null) { { if (m_parentGroup == null) return false; - if (m_parentGroup.RootPart == null) + if (m_parentGroup.IsDeleted) return false; return m_parentGroup.RootPart.DIE_AT_EDGE; @@ -1604,7 +1604,7 @@ if (m_shape != null) { } if (m_parentGroup == null) return; - if (m_parentGroup.RootPart == null) + if (m_parentGroup.IsDeleted) return; if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_start) != 0) @@ -2251,7 +2251,7 @@ if (m_shape != null) { { if (m_parentGroup == null) return; - if (m_parentGroup.RootPart == null) + if (m_parentGroup.IsDeleted) return; m_parentGroup.RootPart.DIE_AT_EDGE = p; @@ -3022,7 +3022,7 @@ if (m_shape != null) { DoPhysicsPropertyUpdate(UsePhysics, false); if (m_parentGroup != null) { - if (m_parentGroup.RootPart != null) + if (!m_parentGroup.IsDeleted) { if (LocalId == m_parentGroup.RootPart.LocalId) { @@ -3070,7 +3070,7 @@ if (m_shape != null) { DoPhysicsPropertyUpdate(UsePhysics, true); if (m_parentGroup != null) { - if (m_parentGroup.RootPart != null) + if (!m_parentGroup.IsDeleted) { if (LocalId == m_parentGroup.RootPart.LocalId) { @@ -3086,7 +3086,7 @@ if (m_shape != null) { DoPhysicsPropertyUpdate(UsePhysics, false); if (m_parentGroup != null) { - if (m_parentGroup.RootPart != null) + if (!m_parentGroup.IsDeleted) { if (LocalId == m_parentGroup.RootPart.LocalId) { @@ -3341,7 +3341,7 @@ if (m_shape != null) { public void SendTerseUpdateToClient(IClientAPI remoteClient) { - if (ParentGroup == null || ParentGroup.RootPart == null) + if (ParentGroup == null || ParentGroup.IsDeleted) return; Vector3 lPos = OffsetPosition; -- cgit v1.1