예제 #1
0
 public void Dispose()
 {
     lock (this)
     {
         // Owner stream must be disposed before returning the hash algorithm to pool
         Contract.Requires(_ownerStream._disposed);
         _hasherToken.Dispose();
     }
 }
예제 #2
0
            /// <inheritdoc />
            protected override void Dispose(bool disposing)
            {
                if (_disposed)
                {
                    return;
                }

                _disposed = true;

                if (disposing && !_finalized)
                {
                    FinishHash();
                }

                _hasherHandle.Dispose();

                Interlocked.Increment(ref _hasher._calls);
            }
예제 #3
0
            /// <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);
            }