From f3134b5cf688af9b824880e0221072b24d22f33e Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 10 Jul 2012 22:41:11 +0100
Subject: 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.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index ec911a5..25223b9 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2183,13 +2183,30 @@ namespace OpenSim.Region.Framework.Scenes
///
/// Synchronously delete the given object from the scene.
///
+ ///
+ /// Scripts are also removed.
+ ///
/// Object Id
/// Suppress broadcasting changes to other clients.
public void DeleteSceneObject(SceneObjectGroup group, bool silent)
+ {
+ DeleteSceneObject(group, silent, true);
+ }
+
+ ///
+ /// Synchronously delete the given object from the scene.
+ ///
+ /// Object Id
+ /// Suppress broadcasting changes to other clients.
+ /// If true, then scripts are removed. If false, then they are only stopped.
+ public void DeleteSceneObject(SceneObjectGroup group, bool silent, bool removeScripts)
{
// m_log.DebugFormat("[SCENE]: Deleting scene object {0} {1}", group.Name, group.UUID);
- group.RemoveScriptInstances(true);
+ if (removeScripts)
+ group.RemoveScriptInstances(true);
+ else
+ group.StopScriptInstances();
SceneObjectPart[] partList = group.Parts;
--
cgit v1.1