예제 #1
0
 private void DisposeInternal()
 {
     if (_reader != null)
     {
         _reader.Dispose();
         _reader = null;
     }
     if (_byteStream != null)
     {
         _byteStream.Dispose();
         _byteStream = null;
     }
     if (_stream != null)
     {
         _stream.Dispose();
         _stream = null;
     }
 }
예제 #2
0
 protected virtual void Dispose(bool disposing)
 {
     lock (_lockObj)
     {
         if (_reader != null)
         {
             _reader.Dispose();
             _reader = null;
         }
         if (_byteStream != null)
         {
             Marshal.ReleaseComObject(_byteStream);
             _byteStream = null;
         }
         if (_stream != null)
         {
             _stream.Dispose();
             _stream = null;
         }
     }
 }