protected void free() { if (BaseStream != null) { BaseStream.Dispose(); } }
protected override void Dispose(bool disposing) { if (disposing) { BaseStream.Dispose(); } }
/// <summary> /// Releases all resources used by the current instance of the Rant.IO.EasyWriter class. /// </summary> public void Dispose() { if (!_leaveOpen) { BaseStream.Dispose(); } }
protected override void Dispose(bool disposing) { if (disposing && !_disposed) { if (BaseStream != null) { if (_mode == Mode.Compress) { Flush(); } if (!_leaveOpen) { BaseStream.Dispose(); } BaseStream = null; } switch (ZLibInit.Lib.PlatformLongSize) { case PlatformLongSize.Long32: { if (_zs32 != null) { if (_mode == Mode.Compress) { ZLibInit.Lib.L32.DeflateEnd(_zs32); } else { ZLibInit.Lib.L32.InflateEnd(_zs32); } _zsPin.Free(); _zs32 = null; } break; } case PlatformLongSize.Long64: { if (_zs64 != null) { if (_mode == Mode.Compress) { ZLibInit.Lib.L64.DeflateEnd(_zs64); } else { ZLibInit.Lib.L64.InflateEnd(_zs64); } _zsPin.Free(); _zs64 = null; } break; } } _disposed = true; } }
public void Dispose() { if (!m_disposed) { m_disposed = true; BaseStream.Dispose(); } }
/// <inheritdocs/> protected override void Dispose(DisposeObjectKind disposeKind) { if (disposeKind == DisposeObjectKind.ManagedAndUnmanagedResources && BaseStream != null) { BaseStream.Dispose(); } }
/// <inheritdocs/> protected override void Dispose(DisposeObjectKind disposeKind) { if (!IsDisposed && disposeKind == DisposeObjectKind.ManagedAndUnmanagedResources) { BaseStream.Dispose(); } }
/// <summary> /// Disposes of the underlying stream. /// </summary> public void Dispose() { if (BaseStream != null) { BaseStream.Dispose(); BaseStream = null; } }
public void Dispose() { BaseStream.Dispose(); BaseStream.Flush(); m_writer.Flush(); m_writer.Dispose(); m_writer = null; }
/// <summary> /// Dispose internal <see cref="PipeStream"/> /// </summary> public void Dispose() { BaseStream.Dispose(); // This is redundant, just to avoid mistakes and follow the general logic of Dispose Reader.Dispose(); Writer.Dispose(); }
/// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> /// <param name="managed"> /// <c>true</c> to release both managed and unmanaged resources; <c>false</c> to release /// only unmanaged resources. /// </param> protected virtual void Dispose(bool managed) { if (!managed || BaseStream is null) { return; } BaseStream.Dispose(); BaseStream = null; }
/// <summary>Gets the content written to the stream as a block of bytes.</summary> /// <returns>The block of bytes.</returns> public virtual byte[] GetResult() { byte[] r = ((MemoryStream)BaseStream).ToArray(); #if !NETFX_CORE BaseStream.Close(); #endif BaseStream.Dispose(); return(r); }
/// <summary> /// Cleanup the underlying stream. /// </summary> /// <param name="disposing"></param> protected override void Dispose(bool disposing) { if (disposing && ownStream) { BaseStream.Dispose(); } base.Dispose(disposing); }
/// <summary> /// Releases all resources used by the underlying instance of the <see cref="Stream" />. /// </summary> public void Dispose() { Writer?.Dispose(); Reader?.Dispose(); if (!LeaveOpen) { BaseStream.Dispose(); } }
/// <summary> /// Dispose of the object and release all resources /// </summary> public void Dispose() { if (BaseStream != null) { BaseStream.Dispose(); } IsDisposed = true; }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (_ownsBaseStream && disposing) { BaseStream.Dispose(); } }
protected override void Dispose(bool disposing) { BaseStream.Dispose(); base.Dispose(disposing); if (disposeNotCalledBefore) { disposeNotCalledBefore = false; Disposed?.Invoke(this, new EventArgs()); } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); BaseStream.Dispose(); foreach (var writer in CopyWriters) { writer.Dispose(); } CopyWriters.Clear(); }
protected virtual void Dispose(bool disposing) { if (disposing) { if (disposeStream) { BaseStream.Dispose(); } } }
public void Dispose() { lock (flushLock) { BaseStream.Dispose(); writer.Flush(); writer.Dispose(); diagnosticOutputStream.Dispose(); } }
/// <summary> /// Releases the unmanaged resources used by the <see cref="BoundStream"/> and /// optionally releases the managed resources. /// </summary> /// <remarks> /// If the <see cref="LeaveOpen"/> property is <c>false</c>, then /// the <see cref="BaseStream"/> is also disposed. /// </remarks> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; /// <c>false</c> to release only the unmanaged resources.</param> protected override void Dispose(bool disposing) { if (disposing && !LeaveOpen) { BaseStream.Dispose(); } base.Dispose(disposing); disposed = true; }
protected virtual void Dispose(bool disposing) { if (DisposeBaseSource) { if (BaseStream != null) { BaseStream.Dispose(); } _baseStream = null; } }
/// <summary> /// Dispose internal <see cref="PipeStream"/> /// </summary> public async ValueTask DisposeAsync() { #if NETSTANDARD2_0 BaseStream.Dispose(); await Task.Delay(0).ConfigureAwait(false); #else await BaseStream.DisposeAsync().ConfigureAwait(false); #endif SemaphoreSlim.Dispose(); }
protected void Dispose(bool disposing) { buffer = null; if (BaseStream != null) { BaseStream.Dispose(); } BaseStream = null; }
protected virtual void DoDispose(bool disposing) { if (disposing) { if (!leaveOpen) { BaseStream.Dispose(); } BaseStream = null; } }
/// <summary> /// Releases the unmanaged resources used by the <see cref="DuplexStream"/> and /// optionally releases the managed resources. /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; /// <c>false</c> to release only the unmanaged resources.</param> protected override void Dispose(bool disposing) { if (disposing && !disposed) { BaseStream.Dispose(); disposed = true; zOut.free(); zIn.free(); } base.Dispose(disposing); }
/// <inheritdoc cref="SerialPort.Dispose"/> public new void Dispose() { if (_isDisposed) { return; } _isDisposed = true; BaseStream.Dispose(); GC.SuppressFinalize(BaseStream); base.Dispose(); GC.SuppressFinalize(this); }
/// <summary> /// Dispose internal <see cref="PipeStream"/> /// </summary> public async ValueTask DisposeAsync() { #if NETSTANDARD2_0 BaseStream.Dispose(); #else await BaseStream.DisposeAsync().ConfigureAwait(false); #endif // This is redundant, just to avoid mistakes and follow the general logic of Dispose await Reader.DisposeAsync().ConfigureAwait(false); await Writer.DisposeAsync().ConfigureAwait(false); }
protected override void Dispose(bool disposing) { if (!_disposed) { if (disposing) { BaseStream.Dispose(); } _disposed = true; } base.Dispose(disposing); }
/// <summary> /// Releases the unmanaged resources used by the <see cref="Patch"/> class and optionally releases the managed resources. /// </summary> /// <param name="disposing"><see cref="true"/> to release both managed and unmanaged resources; <see cref="false"/> to release only unmanaged resources.</param> protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { BaseStream.Dispose(); } blocks = null; disposedValue = true; } }