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); }
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { _instructions?.Clear(); _instructions = null; _executionEnvironment?.Dispose(); _executionEnvironment = null; _executor?.Dispose(); _executor = null; }
private void Dispose(bool disposing) { if (!disposing || _disposed) { return; } Stop(); _queue.Dispose(); _executor.Dispose(); _disposed = true; }
private void CloseFile() { _currentFileStream.Close(); _currentFileName = null; _instructions.Clear(); _instructions = null; _executionEnvironment.Dispose(); _executionEnvironment = null; _executor.Dispose(); _executor = null; ResetUi(); }
/// <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); }
public void OneTimeTearDown() { Executor?.Dispose(); }
public void Dispose() { _executor?.Dispose(); }
private void FrmController_FormClosed(object sender, FormClosedEventArgs e) { executor.Dispose(); }