Skip to content

Commit 619dc8f

Browse files
author
samatrhea
committed
[Implement] SonarQube improvements
1 parent 65f6420 commit 619dc8f

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

SysML2.NET.Viewer/Components/LoginComponent.razor.cs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,28 @@ protected override Task OnInitializedAsync()
6969
/// </summary>
7070
public void Dispose()
7171
{
72-
this.disposables.ForEach(x => x.Dispose());
73-
this.disposables.Clear();
72+
this.Dispose(true);
73+
GC.SuppressFinalize(this);
74+
}
75+
76+
/// <summary>
77+
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
78+
/// </summary>
79+
/// <param name="disposing">
80+
/// A value indicating whether we are performing cleanup or not
81+
/// </param>
82+
protected virtual void Dispose(bool disposing)
83+
{
84+
if (disposing)
85+
{
86+
this.disposables.ForEach(x => x.Dispose());
87+
this.disposables.Clear();
88+
}
89+
}
90+
91+
~LoginComponent()
92+
{
93+
this.Dispose(false);
7494
}
7595
}
7696
}

SysML2.NET.Viewer/Services/CommitHistory/CommitHistoryService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public Commit[] QueryCommitHistory(Branch branch, IEnumerable<Commit> commits)
7474

7575
if (head == null)
7676
{
77-
this.logger.LogWarning($"The head commit is missing from the Branch:{branch.Id}");
77+
this.logger.LogWarning("The head commit is missing from the Branch:{branch}", branch.Id);
7878
}
7979

8080
result.Add(head);

0 commit comments

Comments
 (0)