protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    Archive?.Dispose();
                    ArchiveStream?.Dispose();
                }

                disposedValue = true;
            }
        }
Пример #2
0
 private void CloseStreams()
 {
     if (!_leaveOpen)
     {
         ArchiveStream.Dispose();
         _backingStream?.Dispose();
         ArchiveReader?.Dispose();
     }
     else
     {
         // if _backingStream isn't null, that means we assigned the original stream they passed
         // us to _backingStream (which they requested we leave open), and _archiveStream was
         // the temporary copy that we needed
         if (_backingStream != null)
         {
             ArchiveStream.Dispose();
         }
     }
 }