From 6703be2a90f6e6bce9803e191a1fcc6e9be80fe7 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 19 Aug 2016 14:17:57 +0100 Subject: do not enqueue next event processing if script is in SelfDelete state --- OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 674144b..f75a5d4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -807,9 +807,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance lock (EventQueue) { data = (EventParams)EventQueue.Dequeue(); - if (data == null) // Shouldn't happen + if (data == null) { - if (EventQueue.Count > 0 && Running && !ShuttingDown) + // check if a null event was enqueued or if its really empty + if (EventQueue.Count > 0 && Running && !ShuttingDown && !m_InSelfDelete) { m_CurrentWorkItem = Engine.QueueEventHandler(this); } @@ -979,7 +980,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance ScriptTask.ItemID, ScriptTask.AssetID, data.EventName, EventsProcessed); } - if (EventQueue.Count > 0 && Running && !ShuttingDown) + if (EventQueue.Count > 0 && Running && !ShuttingDown && !m_InSelfDelete) { m_CurrentWorkItem = Engine.QueueEventHandler(this); } -- cgit v1.1