Пример #1
0
        internal T SwitchExecutor <T>(T newExecutor)
            where T : IExecutor
        {
            newExecutor.Init(previous: _executor);
            _executor.Dispose(); // after INIT to make sure the new executor works

            _executor = newExecutor;
            return(newExecutor);
        }
Пример #2
0
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            _instructions?.Clear();
            _instructions = null;

            _executionEnvironment?.Dispose();
            _executionEnvironment = null;

            _executor?.Dispose();
            _executor = null;
        }
Пример #3
0
 private void Dispose(bool disposing)
 {
     if (!disposing || _disposed)
     {
         return;
     }
     Stop();
     _queue.Dispose();
     _executor.Dispose();
     _disposed = true;
 }
Пример #4
0
        private void CloseFile()
        {
            _currentFileStream.Close();
            _currentFileName = null;

            _instructions.Clear();
            _instructions = null;

            _executionEnvironment.Dispose();
            _executionEnvironment = null;

            _executor.Dispose();
            _executor = null;

            ResetUi();
        }
Пример #5
0
 /// <inheritdoc />
 protected override void OnStop()
 {
     _logging.LogDebug("Service stopped.");
     _timer?.Dispose();
     _executor?.Dispose();
     try
     {
         if (_api != null)
         {
             //TODO: find out how to dispose webapp
             // Structure map ioc is buggy and will throw an exception
             // see: https://github.com/WebApiContrib/WebApiContrib.IoC.StructureMap/commit/d0306db2169303f3fdb56a7c7ac940207b5cf0c2
             // Nuget has not been updated since 2012. switch to submodule, or ignore.
             //_api.Dispose();
         }
     }
     catch (Exception e)
     {
         _logging.LogException(e, "Failed to dispose webapp");
     }
 }
        protected IDisposable StateHasChanged(IExecutor executor, bool immediate = true)
        {
            AddStateChange(executor);

            if (immediate)
            {
                StateHasChanged();
            }

            IDisposable disposable = new ActionDisposable(() =>
            {
                PostStateChange.Remove(executor);

                executor.Dispose();
            });

            PropChangeDisposables.Add(disposable);

            Disposables.Add(disposable);

            return(disposable);
        }
Пример #7
0
 public void OneTimeTearDown()
 {
     Executor?.Dispose();
 }
Пример #8
0
 public void Dispose()
 {
     _executor?.Dispose();
 }
Пример #9
0
 private void FrmController_FormClosed(object sender, FormClosedEventArgs e)
 {
     executor.Dispose();
 }