Skip to content

Commit

Permalink
Change IDiagnosticsWriter to implement IDisposable
Browse files Browse the repository at this point in the history
  • Loading branch information
tamasvajk committed Apr 3, 2024
1 parent 0f980e2 commit 305fa84
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cpp/autobuilder/Semmle.Autobuild.Cpp.Tests/BuildScripts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ internal class TestDiagnosticWriter : IDiagnosticsWriter
public IList<DiagnosticMessage> Diagnostics { get; } = new List<DiagnosticMessage>();

public void AddEntry(DiagnosticMessage message) => this.Diagnostics.Add(message);

public void Dispose() { }
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ internal class TestDiagnosticWriter : IDiagnosticsWriter
public IList<DiagnosticMessage> Diagnostics { get; } = new List<DiagnosticMessage>();

public void AddEntry(DiagnosticMessage message) => this.Diagnostics.Add(message);

public void Dispose() { }
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion csharp/autobuilder/Semmle.Autobuild.Shared/Autobuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ protected virtual void Dispose(bool disposing)
{
if (disposing)
{
(diagnostics as IDisposable)?.Dispose();
diagnostics.Dispose();
}
}

Expand Down
2 changes: 1 addition & 1 deletion csharp/extractor/Semmle.Util/ToolStatusPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public DiagnosticMessage(
/// <summary>
/// Provides the ability to write diagnostic messages to some output.
/// </summary>
public interface IDiagnosticsWriter
public interface IDiagnosticsWriter : IDisposable
{
/// <summary>
/// Adds <paramref name="message" /> as a new diagnostics entry.
Expand Down

0 comments on commit 305fa84

Please sign in to comment.