private void MainLoop() { while (!_exit) { LogLine logLine = null; try { logLine = _lines.Take(); } catch (Exception) { _exit = true; } if (logLine != null && (!_exit || _quitWithFlush)) { _writer.Write(logLine); } if (_quitWithFlush && _lines.Count == 0) { _exit = true; } } _lines?.Dispose(); _writer?.Dispose(); }
public override void Dispose() { if (mWriter != null) { mWriter.Dispose(); } base.Dispose(); }
public void Stop() { stop = true; if (consumingThread.IsAlive) { consumingThread.Join(); } fileWriter.Dispose(); }
public void Dispose() { if (_disposed) { return; } _file.Dispose(); _disposed = true; }
public override void Close() { if (_fileWriter == null) { return; } try { _fileWriter.Dispose(); } catch (Exception) { //Ignore this exception, since it will always(?) happen but we still want to make sure the writer is disposed. //Debug.WriteLine($"Exception in writer dispose. {e.Message} {e.StackTrace}"); } }
public void Dispose() => decoratee.Dispose();
public void Dispose() { _fileWriter.Dispose(); }
public virtual void Dispose() { Reader.Dispose(); Writer.Dispose(); }
public void Dispose() { serialPort?.Dispose(); fileWriter?.Dispose(); }