From 746c6fb1a285134b68176d39fe28c90fe861fe2a Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 12 Jul 2008 00:06:45 +0000 Subject: Patch #9141 (Mantis #1655) Untangles llDie handling in XEngine, which resulted in a thread being aborted while executing inside of Scene. --- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/XEngine/XEngine.cs') diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 6372247..9f67dc1 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -874,6 +874,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine private string m_Assembly; private int m_StartParam = 0; private string m_CurrentEvent = String.Empty; + private bool m_InSelfDelete = false; private Dictionary m_Apis = new Dictionary(); @@ -1190,7 +1191,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine if (result == null) return true; - result.Abort(); + if(!m_InSelfDelete) + result.Abort(); lock (m_EventQueue) { @@ -1298,7 +1300,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine m_InEvent = false; m_CurrentEvent = String.Empty; - if (!(e is TargetInvocationException) || !(e.InnerException is EventAbortException)) + if (!(e is TargetInvocationException) || (!(e.InnerException is EventAbortException) && (!(e.InnerException is SelfDeleteException)))) { if (e is System.Threading.ThreadAbortException) { @@ -1340,6 +1342,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine e.ToString()); } } + else if((e is TargetInvocationException) && (e.InnerException is SelfDeleteException)) + { + m_InSelfDelete = true; + if(part != null && part.ParentGroup != null) + m_Engine.World.DeleteSceneObject(part.ParentGroup); + } } } -- cgit v1.1