do not enqueue next event processing if script is in SelfDelete state

LSLKeyTest
UbitUmarov 2016-08-19 14:17:57 +01:00
parent e62d38a4ab
commit 6703be2a90
1 changed files with 4 additions and 3 deletions

View File

@ -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);
}