console region restart: Let Xengine not cry all over the place with

errors also. May not be that good, but is not in use in AVN (i hope). Still safer to do a full shutdown and refire the region from a OS tool like a script, monit, etc etc
avinationmerge
UbitUmarov 2012-07-10 18:23:38 +01:00
parent 4a91c65dbc
commit 6b8b7007c4
1 changed files with 10 additions and 6 deletions

View File

@ -596,7 +596,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (!m_Enabled) if (!m_Enabled)
return; return;
lockScriptsForRead(true); lockScriptsForRead(true);
foreach (IScriptInstance instance in m_Scripts.Values)
List<IScriptInstance> instancesToDel = new List<IScriptInstance>(m_Scripts.Values);
// foreach (IScriptInstance instance in m_Scripts.Values)
foreach (IScriptInstance instance in instancesToDel)
{ {
// Force a final state save // Force a final state save
// //
@ -619,7 +623,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
// Must be done explicitly because they have infinite // Must be done explicitly because they have infinite
// lifetime // lifetime
// //
if (!m_SimulatorShuttingDown) // if (!m_SimulatorShuttingDown)
{ {
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
if (m_DomainScripts[instance.AppDomain].Count == 0) if (m_DomainScripts[instance.AppDomain].Count == 0)
@ -629,10 +633,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
} }
} }
m_Scripts.Clear(); // m_Scripts.Clear();
m_PrimObjects.Clear(); // m_PrimObjects.Clear();
m_Assemblies.Clear(); // m_Assemblies.Clear();
m_DomainScripts.Clear(); // m_DomainScripts.Clear();
} }
lockScriptsForRead(false); lockScriptsForRead(false);
lockScriptsForWrite(true); lockScriptsForWrite(true);