Пример #1
0
 private void DisposeInternal()
 {
     _response.Response.Dispose();
     _parser.Dispose();
     _returnBuffer.Dispose();
     _peepingTomStream.Dispose();
     _builder.Dispose();
     _returnContext.Dispose();
 }
Пример #2
0
 public virtual void Dispose()
 {
     try
     {
         Flush();
     }
     catch (ObjectDisposedException)
     {
         //we are disposing, so this exception doesn't matter
     }
     // TODO: remove when we update to .net core 3
     // https://github.com/dotnet/corefx/issues/36141
     catch (NotSupportedException e)
     {
         throw new IOException("The stream was closed by the peer.", e);
     }
     finally
     {
         _returnBuffer.Dispose();
         _context.ReturnMemory(_parserAuxiliarMemory);
     }
 }
Пример #3
0
 protected void DisposeInternal()
 {
     try
     {
         FlushInternal();
     }
     catch (ObjectDisposedException)
     {
         //we are disposing, so this exception doesn't matter
     }
     // TODO: remove when we update to .net core 3
     // https://github.com/dotnet/corefx/issues/36141
     catch (NotSupportedException e)
     {
         throw new IOException("The stream was closed by the peer.", e);
     }
     finally
     {
         _returnBuffer.Dispose();
         _returnAuxiliarBuffer.Dispose();
     }
 }