From 6de7da467a508a28cd11c13ed1ad2e8400520b21 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 10 Dec 2015 17:04:39 +0000 Subject: keep SOG reference to root part since two many things depend on deleted SOGs not being deleted --- .../Avatar/Attachments/Tests/AttachmentsModuleTests.cs | 4 ++-- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +- .../Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs | 11 +++++++---- 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index 2ef86c9..10b2ff6 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs @@ -721,13 +721,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests acd.Appearance.SetAttachment((int)AttachmentPoint.Chest, attItem.ID, attItem.AssetID); ScenePresence presence = SceneHelpers.AddScenePresence(scene, acd); - SceneObjectGroup rezzedAtt = presence.GetAttachments()[0]; + UUID rezzedAttID = presence.GetAttachments()[0].UUID; m_numberOfAttachEventsFired = 0; scene.CloseAgent(presence.UUID, false); // Check that we can't retrieve this attachment from the scene. - Assert.That(scene.GetSceneObjectGroup(rezzedAtt.UUID), Is.Null); + Assert.That(scene.GetSceneObjectGroup(rezzedAttID), Is.Null); // Check events Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0)); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 473c802..ee0f674 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -4851,7 +4851,7 @@ namespace OpenSim.Region.Framework.Scenes { m_parts.Clear(); m_sittingAvatars.Clear(); - m_rootPart = null; +// m_rootPart = null; m_PlaySoundMasterPrim = null; m_PlaySoundSlavePrims.Clear(); diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs index 098f1b4..ac8c32d 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs @@ -171,11 +171,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Test that we don't get back an object for a local id that doesn't exist Assert.That(scene.GetGroupByPrim(999), Is.Null); + uint soid = so.LocalId; + uint spid = parts[partsToTestCount - 1].LocalId; + // Now delete the scene object and check again scene.DeleteSceneObject(so, false); - Assert.That(scene.GetGroupByPrim(so.LocalId), Is.Null); - Assert.That(scene.GetGroupByPrim(parts[partsToTestCount - 1].LocalId), Is.Null); + Assert.That(scene.GetGroupByPrim(soid), Is.Null); + Assert.That(scene.GetGroupByPrim(spid), Is.Null); } /// @@ -194,12 +197,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests SceneObjectGroup so = SceneHelpers.AddSceneObject(scene); Assert.That(so.IsDeleted, Is.False); + uint retrievedPartID = so.LocalId; scene.DeleteSceneObject(so, false); - Assert.That(so.IsDeleted, Is.True); + SceneObjectPart retrievedPart = scene.GetSceneObjectPart(retrievedPartID); - SceneObjectPart retrievedPart = scene.GetSceneObjectPart(so.LocalId); Assert.That(retrievedPart, Is.Null); } -- cgit v1.1