Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/ModularPipelines/Logging/ModuleOutputWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ internal void SetException(Exception exception)
/// <summary>
/// Flushes all buffered output with section header/footer.
/// </summary>
/// <remarks>
/// No finalizer is needed since this class only manages managed resources.
/// If Dispose is not called, the IServiceScope will be cleaned up by GC.
/// </remarks>
public void Dispose()
{
lock (_writeLock)
Expand All @@ -133,6 +137,7 @@ public void Dispose()

if (!_buffer.HasEvents)
{
_scope.Dispose();
return;
}

Expand Down Expand Up @@ -173,12 +178,6 @@ public void Dispose()
}

_scope.Dispose();
GC.SuppressFinalize(this);
}

~ModuleOutputWriter()
{
Dispose();
}

/// <summary>
Expand Down
Loading