Fixed bug that occurs sometimes on script unload where queued script event was attempted executed after AppDomain was unloaded.
parent
0cd6d26adb
commit
25e200c46a
|
@ -130,6 +130,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
|
||||||
{
|
{
|
||||||
QueueItemStruct BlankQIS = new QueueItemStruct();
|
QueueItemStruct BlankQIS = new QueueItemStruct();
|
||||||
while (true)
|
while (true)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
QueueItemStruct QIS = BlankQIS;
|
QueueItemStruct QIS = BlankQIS;
|
||||||
bool GotItem = false;
|
bool GotItem = false;
|
||||||
|
@ -182,6 +184,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Something in queue
|
} // Something in queue
|
||||||
|
} catch {ThreadAbortException tae) {
|
||||||
|
throw tae;
|
||||||
|
} catch (Exception e) {
|
||||||
|
Console.WriteLine("Exception in EventQueueThreadLoop: " + e.ToString());
|
||||||
|
}
|
||||||
} // while
|
} // while
|
||||||
} // try
|
} // try
|
||||||
catch (ThreadAbortException tae)
|
catch (ThreadAbortException tae)
|
||||||
|
|
|
@ -362,9 +362,18 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
|
||||||
// Execute a function in the script
|
// Execute a function in the script
|
||||||
//m_scriptEngine.Log.Verbose("ScriptEngine", "Executing Function localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName);
|
//m_scriptEngine.Log.Verbose("ScriptEngine", "Executing Function localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName);
|
||||||
LSL_BaseClass Script = m_scriptEngine.myScriptManager.GetScript(localID, itemID);
|
LSL_BaseClass Script = m_scriptEngine.myScriptManager.GetScript(localID, itemID);
|
||||||
|
if (Script == null)
|
||||||
|
return;
|
||||||
|
|
||||||
// Must be done in correct AppDomain, so leaving it up to the script itself
|
// Must be done in correct AppDomain, so leaving it up to the script itself
|
||||||
|
try
|
||||||
|
{
|
||||||
Script.Exec.ExecuteEvent(FunctionName, args);
|
Script.Exec.ExecuteEvent(FunctionName, args);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Exception executing script funcion: " + e.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue