public void Dispose() { lock (this) { // Owner stream must be disposed before returning the hash algorithm to pool Contract.Requires(_ownerStream._disposed); _hasherToken.Dispose(); } }
/// <inheritdoc /> protected override void Dispose(bool disposing) { if (_disposed) { return; } _disposed = true; if (disposing && !_finalized) { FinishHash(); } _hasherHandle.Dispose(); Interlocked.Increment(ref _hasher._calls); }
/// <inheritdoc /> protected override void Dispose(bool disposing) { if (_disposed) { return; } _disposed = true; if (disposing && !_finalized) { FinishHash(); } if (disposing) { // Disposing the owning resources only during disposal and not during the finalization. _hasherHandle.Dispose(); } Interlocked.Increment(ref _hasher._calls); }