In AttachmentsModule.DetachSingleAttachmentToInvInternal(), remove attachment before changing properties for correct inventory serialization.

Serialization of attachments requires IsAttachment = false so that correct positions are serialized instead of avatar position.
However, doing this when a hud is still attached allows race conditions with update threads, resulting in hud artifacts on other viewers.
This change sets SOG.IsDeleted before serialization changes take place (IsDeleted itself is not a serialized property).
LLClientView then screens out any deleted SOGs before sending updates to viewers.
This commit is contained in:
Justin Clark-Casey (justincc)
2012-06-25 21:08:19 +01:00
parent 6d3ee8bb39
commit 5301648cff
3 changed files with 42 additions and 2 deletions

View File

@@ -187,8 +187,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests
TestScene scene = new SceneHelpers().SetupScene();
SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
Assert.That(part.ParentGroup.IsDeleted, Is.False);
scene.DeleteSceneObject(part.ParentGroup, false);
Assert.That(part.ParentGroup.IsDeleted, Is.True);
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
Assert.That(retrievedPart, Is.Null);
}
@@ -219,8 +224,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests
Assert.That(retrievedPart, Is.Not.Null);
Assert.That(part.ParentGroup.IsDeleted, Is.False);
sogd.InventoryDeQueueAndDelete();
Assert.That(part.ParentGroup.IsDeleted, Is.True);
SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(part.LocalId);
Assert.That(retrievedPart2, Is.Null);
}