diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 08f9545..30002e8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -74,6 +74,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
74 | private bool m_InSelfDelete = false; | 74 | private bool m_InSelfDelete = false; |
75 | private int m_MaxScriptQueue; | 75 | private int m_MaxScriptQueue; |
76 | private bool m_SaveState = true; | 76 | private bool m_SaveState = true; |
77 | private bool m_ShuttingDown = false; | ||
77 | 78 | ||
78 | private Dictionary<string,IScriptApi> m_Apis = new Dictionary<string,IScriptApi>(); | 79 | private Dictionary<string,IScriptApi> m_Apis = new Dictionary<string,IScriptApi>(); |
79 | 80 | ||
@@ -88,6 +89,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
88 | set { m_RunEvents = value; } | 89 | set { m_RunEvents = value; } |
89 | } | 90 | } |
90 | 91 | ||
92 | public bool ShuttingDown | ||
93 | { | ||
94 | get { return m_ShuttingDown; } | ||
95 | set { m_ShuttingDown = value; } | ||
96 | } | ||
97 | |||
91 | public string State | 98 | public string State |
92 | { | 99 | { |
93 | get { return m_State; } | 100 | get { return m_State; } |
@@ -248,7 +255,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
248 | 255 | ||
249 | m_Engine.Log.DebugFormat("[Script] Successfully retrieved state for script {0}.{1}", m_PrimName, m_ScriptName); | 256 | m_Engine.Log.DebugFormat("[Script] Successfully retrieved state for script {0}.{1}", m_PrimName, m_ScriptName); |
250 | 257 | ||
251 | if (m_RunEvents) | 258 | if (m_RunEvents && (!m_ShuttingDown)) |
252 | { | 259 | { |
253 | m_RunEvents = false; | 260 | m_RunEvents = false; |
254 | Start(); | 261 | Start(); |
@@ -517,7 +524,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
517 | { | 524 | { |
518 | lock (m_EventQueue) | 525 | lock (m_EventQueue) |
519 | { | 526 | { |
520 | if ((m_EventQueue.Count > 0) && m_RunEvents) | 527 | if ((m_EventQueue.Count > 0) && m_RunEvents && (!m_ShuttingDown)) |
521 | { | 528 | { |
522 | m_CurrentResult=m_Engine.QueueEventHandler(this); | 529 | m_CurrentResult=m_Engine.QueueEventHandler(this); |
523 | } | 530 | } |
@@ -564,7 +571,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
564 | 571 | ||
565 | lock (m_EventQueue) | 572 | lock (m_EventQueue) |
566 | { | 573 | { |
567 | if ((m_EventQueue.Count > 0) && m_RunEvents) | 574 | if ((m_EventQueue.Count > 0) && m_RunEvents && (!m_ShuttingDown)) |
568 | { | 575 | { |
569 | m_CurrentResult = m_Engine.QueueEventHandler(this); | 576 | m_CurrentResult = m_Engine.QueueEventHandler(this); |
570 | } | 577 | } |