private void Dispose(bool disposing) { if (!disposed) { if (disposing) { try { // release managed components Disconnect(); DebugEngine?.Dispose(); } catch { } } disposed = true; } }
public NanoDevice() { Device = new T(); if (Device is NanoUsbDevice) { Transport = TransportType.Usb; } SuicideTimer = new Timer((state) => { Task.Factory.StartNew(() => { // set kill flag KillFlag = true; DebugEngine.Dispose(); Dispose(false); }); }, null, Timeout.Infinite, Timeout.Infinite); }