mantis 8972: avoid null ref plus cosmetics

This commit is contained in:
UbitUmarov
2022-02-10 16:37:37 +00:00
parent 9d390564a9
commit 6a0f29f182
5 changed files with 10 additions and 53 deletions

View File

@@ -135,10 +135,9 @@ namespace OpenSim.Region.ScriptEngine.Yengine
// Initialize the API instance.
scriptApi.Initialize(m_Engine, m_Part, m_Item);
this.InitApi(api, scriptApi);
InitApi(api, scriptApi);
}
/*
* Get script object code loaded in memory and all ready to run,
* ready to resume it from where the .state file says it was last
@@ -250,7 +249,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
}
catch
{
// If any error loading, decrement object code reference count.
DecObjCodeRefCount();
throw;
@@ -326,16 +324,15 @@ namespace OpenSim.Region.ScriptEngine.Yengine
private void LoadObjCode()
{
// Script must leave this much stack remaining on calls to CheckRun().
this.stackLimit = m_StackSize / 2;
stackLimit = m_StackSize / 2;
// This is how many total heap bytes script is allowed to use.
this.heapLimit = m_HeapSize;
heapLimit = m_HeapSize;
// Allocate global variable arrays.
this.glblVars.AllocVarArrays(m_ObjCode.glblSizes);
glblVars.AllocVarArrays(m_ObjCode.glblSizes);
// Script can handle these event codes.
m_HaveEventHandlers = new bool[m_ObjCode.scriptEventHandlerTable.GetLength(1)];
for(int i = m_ObjCode.scriptEventHandlerTable.GetLength(0); --i >= 0;)
{
for(int j = m_ObjCode.scriptEventHandlerTable.GetLength(1); --j >= 0;)