Skip to content

Commit

Permalink
Fixed SonarCloud issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Denrage committed Mar 11, 2024
1 parent d50550f commit 84533cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Blish HUD/GameServices/ArcDps/V2/ArcDpsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void RegisterMessageTypeListener<T>(int type, Func<T, CancellationToken,
}

private void ProcessMessage(MessageProcessor processor, BlockingCollection<byte[]> messageQueue) {
while (true) {
while (!ct.IsCancellationRequested) {
ct.ThrowIfCancellationRequested();
Task.Delay(1).Wait();
foreach (var item in messageQueue.GetConsumingEnumerable()) {
Expand All @@ -78,6 +78,8 @@ private void ProcessMessage(MessageProcessor processor, BlockingCollection<byte[
ArrayPool<byte>.Shared.Return(item);
}
}

ct.ThrowIfCancellationRequested();
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Blish HUD/GameServices/ArcDpsServiceV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private static int GetPort(uint processId, ArcDpsBridgeVersion version) {
protected override void Unload() {
Gw2Mumble.Info.ProcessIdChanged -= Start;
_arcDpsClientCancellationTokenSource.Cancel();

_arcDpsClientCancellationTokenSource.Dispose();
_stopwatch.Stop();
_arcDpsClient.Disconnect();
_arcDpsClient.Error -= SocketErrorHandler;
Expand Down

0 comments on commit 84533cd

Please sign in to comment.