Ejemplo n.º 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();
     }
 }
Ejemplo n.º 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);
            }
Ejemplo n.º 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);
            }