keep SOG reference to root part since two many things depend on deleted SOGs not being deleted

LSLKeyTest
UbitUmarov 2015-12-10 17:04:39 +00:00
parent 62009ba9c0
commit 6de7da467a
3 changed files with 10 additions and 7 deletions

View File

@ -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));

View File

@ -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();

View File

@ -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);
}
/// <summary>
@ -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);
}