More locks, try's and disable some things in SEC - maybe it won't crash now. :)

0.6.0-stable
Tedd Hansen 2008-09-21 01:09:54 +00:00
parent 9c8aeff27c
commit ec494275a2
3 changed files with 27 additions and 14 deletions

View File

@ -72,13 +72,19 @@ namespace OpenSim.ApplicationPlugins.ScriptEngine
{
// We have found an type which is derived from ProdiverBase, add it to provider list
m_log.InfoFormat("[ScriptEngine]: Adding component: {0}", componentType.Name);
ComponentRegistry.providers.Add(componentType.Name, componentType);
lock (ComponentRegistry.providers)
{
ComponentRegistry.providers.Add(componentType.Name, componentType);
}
}
if (componentType.IsSubclassOf(typeof(RegionScriptEngineBase)))
{
// We have found an type which is derived from RegionScriptEngineBase, add it to engine list
m_log.InfoFormat("[ScriptEngine]: Adding script engine: {0}", componentType.Name);
ComponentRegistry.scriptEngines.Add(componentType.Name, componentType);
lock (ComponentRegistry.scriptEngines)
{
ComponentRegistry.scriptEngines.Add(componentType.Name, componentType);
}
}
}
}

View File

@ -74,16 +74,19 @@ namespace OpenSim.ApplicationPlugins.ScriptEngine
m_log.Info("[" + Name + "]: Loading: " + c);
lock (Components)
{
try
lock (ComponentRegistry.providers)
{
if (ComponentRegistry.providers.ContainsKey(c))
Components.Add(Activator.CreateInstance(ComponentRegistry.providers[c]) as ComponentBase);
else
m_log.Error("[" + Name + "]: Component \"" + c + "\" not found, can not load");
}
catch (Exception ex)
{
m_log.Error("[" + Name + "]: Exception loading \"" + c + "\": " + ex.ToString());
try
{
if (ComponentRegistry.providers.ContainsKey(c))
Components.Add(Activator.CreateInstance(ComponentRegistry.providers[c]) as ComponentBase);
else
m_log.Error("[" + Name + "]: Component \"" + c + "\" not found, can not load");
}
catch (Exception ex)
{
m_log.Error("[" + Name + "]: Exception loading \"" + c + "\": " + ex.ToString());
}
}
}
}

View File

@ -43,13 +43,17 @@ namespace OpenSim.ApplicationPlugins.ScriptEngine
public RegionScriptEngineBase scriptEngine;
public void Initialise(Scene scene, IConfigSource source)
{
return;
// New region is being created
// Create a new script engine
try
{
scriptEngine =
Activator.CreateInstance(ComponentRegistry.scriptEngines[tempScriptEngineName]) as
RegionScriptEngineBase;
lock (ComponentRegistry.scriptEngines)
{
scriptEngine =
Activator.CreateInstance(ComponentRegistry.scriptEngines[tempScriptEngineName]) as
RegionScriptEngineBase;
}
scriptEngine.Initialize(scene, source);
}
catch (Exception ex)