When an attachment is detached to inv or derezzed, stop the scripts, update the known item with script state still in the script engine and then remove the scripts.

This is to fix a regression starting from 5301648 where attachments had to start being deleted before persistence in order to avoid race conditions with hud update threads.
This commit is contained in:
Justin Clark-Casey (justincc)
2012-07-10 22:41:11 +01:00
parent eb5ec4a786
commit f3134b5cf6
5 changed files with 110 additions and 13 deletions

View File

@@ -79,7 +79,7 @@ namespace OpenSim.Region.Framework.Scenes
}
/// <summary>
/// Stop the scripts contained in all the prims in this group
/// Stop and remove the scripts contained in all the prims in this group
/// </summary>
/// <param name="sceneObjectBeingDeleted">
/// Should be true if these scripts are being removed because the scene
@@ -92,6 +92,14 @@ namespace OpenSim.Region.Framework.Scenes
parts[i].Inventory.RemoveScriptInstances(sceneObjectBeingDeleted);
}
/// <summary>
/// Stop the scripts contained in all the prims in this group
/// </summary>
public void StopScriptInstances()
{
Array.ForEach<SceneObjectPart>(m_parts.GetArray(), p => p.Inventory.StopScriptInstances());
}
/// <summary>
/// Add an inventory item from a user's inventory to a prim in this scene object.
/// </summary>