diff options
Merge branch 'master' into bigmerge
Conflicts:
OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine/XEngine.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 402377d..65c7416 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -91,6 +91,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
91 | private bool m_KillTimedOutScripts; | 91 | private bool m_KillTimedOutScripts; |
92 | private string m_ScriptEnginesPath = null; | 92 | private string m_ScriptEnginesPath = null; |
93 | 93 | ||
94 | /// <summary> | ||
95 | /// Is the entire simulator in the process of shutting down? | ||
96 | /// </summary> | ||
97 | private bool m_SimulatorShuttingDown; | ||
98 | |||
94 | private static List<XEngine> m_ScriptEngines = | 99 | private static List<XEngine> m_ScriptEngines = |
95 | new List<XEngine>(); | 100 | new List<XEngine>(); |
96 | 101 | ||
@@ -537,12 +542,20 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
537 | // Must be done explicitly because they have infinite | 542 | // Must be done explicitly because they have infinite |
538 | // lifetime | 543 | // lifetime |
539 | // | 544 | // |
540 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); | 545 | if (!m_SimulatorShuttingDown) |
541 | if (m_DomainScripts[instance.AppDomain].Count == 0) | ||
542 | { | 546 | { |
543 | m_DomainScripts.Remove(instance.AppDomain); | 547 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); |
544 | UnloadAppDomain(instance.AppDomain); | 548 | if (m_DomainScripts[instance.AppDomain].Count == 0) |
549 | { | ||
550 | m_DomainScripts.Remove(instance.AppDomain); | ||
551 | UnloadAppDomain(instance.AppDomain); | ||
552 | } | ||
545 | } | 553 | } |
554 | |||
555 | m_Scripts.Clear(); | ||
556 | m_PrimObjects.Clear(); | ||
557 | m_Assemblies.Clear(); | ||
558 | m_DomainScripts.Clear(); | ||
546 | } | 559 | } |
547 | lockScriptsForRead(false); | 560 | lockScriptsForRead(false); |
548 | lockScriptsForWrite(true); | 561 | lockScriptsForWrite(true); |
@@ -1512,6 +1525,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1512 | 1525 | ||
1513 | public void OnShutdown() | 1526 | public void OnShutdown() |
1514 | { | 1527 | { |
1528 | m_SimulatorShuttingDown = true; | ||
1529 | |||
1515 | List<IScriptInstance> instances = new List<IScriptInstance>(); | 1530 | List<IScriptInstance> instances = new List<IScriptInstance>(); |
1516 | 1531 | ||
1517 | lockScriptsForRead(true); | 1532 | lockScriptsForRead(true); |
@@ -1907,4 +1922,4 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1907 | return true; | 1922 | return true; |
1908 | } | 1923 | } |
1909 | } | 1924 | } |
1910 | } \ No newline at end of file | 1925 | } |