diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 98e77c0..46d674d 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -277,7 +277,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
277 | // Clear the event queue and abort the instance thread | 277 | // Clear the event queue and abort the instance thread |
278 | // | 278 | // |
279 | instance.ClearQueue(); | 279 | instance.ClearQueue(); |
280 | instance.Stop(0); | 280 | bool stopped = instance.Stop(0); |
281 | 281 | ||
282 | // Release events, timer, etc | 282 | // Release events, timer, etc |
283 | // | 283 | // |
@@ -287,7 +287,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
287 | // Must be done explicitly because they have infinite | 287 | // Must be done explicitly because they have infinite |
288 | // lifetime | 288 | // lifetime |
289 | // | 289 | // |
290 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); | 290 | if (stopped) |
291 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); | ||
291 | if (m_DomainScripts[instance.AppDomain].Count == 0) | 292 | if (m_DomainScripts[instance.AppDomain].Count == 0) |
292 | { | 293 | { |
293 | m_DomainScripts.Remove(instance.AppDomain); | 294 | m_DomainScripts.Remove(instance.AppDomain); |
@@ -804,7 +805,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
804 | m_Scripts.Remove(itemID); | 805 | m_Scripts.Remove(itemID); |
805 | 806 | ||
806 | instance.ClearQueue(); | 807 | instance.ClearQueue(); |
807 | instance.Stop(0); | 808 | bool stopped = instance.Stop(0); |
808 | 809 | ||
809 | // bool objectRemoved = false; | 810 | // bool objectRemoved = false; |
810 | 811 | ||
@@ -829,7 +830,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
829 | instance.RemoveState(); | 830 | instance.RemoveState(); |
830 | instance.DestroyScriptInstance(); | 831 | instance.DestroyScriptInstance(); |
831 | 832 | ||
832 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); | 833 | if (stopped) |
834 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); | ||
833 | if (m_DomainScripts[instance.AppDomain].Count == 0) | 835 | if (m_DomainScripts[instance.AppDomain].Count == 0) |
834 | { | 836 | { |
835 | m_DomainScripts.Remove(instance.AppDomain); | 837 | m_DomainScripts.Remove(instance.AppDomain); |