예제 #1
0
        private void DisposeImpl(bool disposing)
        {
            if (disposing && _childContexts != null)
            {
                StreamSource.Dispose();

                foreach (var serializationContext in _childContexts)
                {
                    serializationContext.Value.Dispose();
                }
            }

            _backgroundStream?.Stream?.Dispose();

            if (_binaryWriter != null)
            {
                _binaryWriter.Dispose();
                _binaryWriter = null;
            }

            if (_binaryReader != null)
            {
                _binaryReader.Dispose();
                _binaryReader = null;
            }

            if (_textReader != null)
            {
                _textReader.Dispose();
                _textReader = null;
            }

            if (_textWriter == null)
            {
                return;
            }
            _textWriter.Dispose();
            _textWriter = null;
        }
 public void Dispose()
 {
     streamSource?.Dispose();
     blob?.Dispose();
 }