protected virtual void Dispose(bool disposing) { if (disposing) { _disposed = true; _readCipher?.Dispose(); _readCipher = null; CipherLib?.Dispose(); CipherLib = null; } }
public void Add(ICipher cipher) { try { EnsureObjectNotDisposed(); _list.Add(cipher); } catch (Exception) { cipher.Dispose(); throw; } }
protected override void Dispose(bool disposing) { if (disposing) { if (_canDisposeStream) { _stream?.Dispose(); } _stream = null; _cipher?.Dispose(); _cipher = null; } base.Dispose(disposing); }