diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 2886344..cc783aa 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -636,7 +636,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
636 | if (!m_Enabled) | 636 | if (!m_Enabled) |
637 | return; | 637 | return; |
638 | lockScriptsForRead(true); | 638 | lockScriptsForRead(true); |
639 | foreach (IScriptInstance instance in m_Scripts.Values) | 639 | |
640 | List<IScriptInstance> instancesToDel = new List<IScriptInstance>(m_Scripts.Values); | ||
641 | |||
642 | // foreach (IScriptInstance instance in m_Scripts.Values) | ||
643 | foreach (IScriptInstance instance in instancesToDel) | ||
640 | { | 644 | { |
641 | // Force a final state save | 645 | // Force a final state save |
642 | // | 646 | // |
@@ -659,7 +663,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
659 | // Must be done explicitly because they have infinite | 663 | // Must be done explicitly because they have infinite |
660 | // lifetime | 664 | // lifetime |
661 | // | 665 | // |
662 | if (!m_SimulatorShuttingDown) | 666 | // if (!m_SimulatorShuttingDown) |
663 | { | 667 | { |
664 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); | 668 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); |
665 | if (m_DomainScripts[instance.AppDomain].Count == 0) | 669 | if (m_DomainScripts[instance.AppDomain].Count == 0) |
@@ -669,10 +673,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
669 | } | 673 | } |
670 | } | 674 | } |
671 | 675 | ||
672 | m_Scripts.Clear(); | 676 | // m_Scripts.Clear(); |
673 | m_PrimObjects.Clear(); | 677 | // m_PrimObjects.Clear(); |
674 | m_Assemblies.Clear(); | 678 | // m_Assemblies.Clear(); |
675 | m_DomainScripts.Clear(); | 679 | // m_DomainScripts.Clear(); |
676 | } | 680 | } |
677 | lockScriptsForRead(false); | 681 | lockScriptsForRead(false); |
678 | lockScriptsForWrite(true); | 682 | lockScriptsForWrite(true); |