protected override void Dispose(bool disposing) { if (_sftpSession != null) { _sftpSession.Dispose(); _sftpSession = null; } base.Dispose(disposing); }
// Protected implementation of Dispose pattern. protected virtual void Dispose(bool disposing) { if (disposed) { return; } if (disposing) { SftpSession?.Dispose(); } disposed = true; }