示例#1
0
        public int Start()
        {
            int exitCode = 0;

            try
            {
                MachineInstance.Current.EventProcessor = new DefaultEventProcessor();
                _engine.UpdateContexts();
                _engine.NewObject(_module);
                exitCode = 0;
            }
            catch (ScriptInterruptionException e)
            {
                exitCode = e.ExitCode;
            }
            catch (Exception e)
            {
                _host.ShowExceptionInfo(e);
                exitCode = 1;
            }
            finally
            {
                _engine.DebugController?.NotifyProcessExit(exitCode);
                _engine.Dispose();
                _engine = null;
            }

            return(exitCode);
        }
示例#2
0
 public int Start()
 {
     try
     {
         _engine.NewObject(_module);
         return(0);
     }
     catch (ScriptInterruptionException e)
     {
         return(e.ExitCode);
     }
     catch (Exception e)
     {
         _host.ShowExceptionInfo(e);
         return(1);
     }
     finally
     {
         _engine.Dispose();
         _engine = null;
     }
 }
示例#3
0
 public void Dispose()
 {
     _engine?.Dispose();
     _codeStat?.EndCodeStat();
 }