Fixed two reliability issues highlighted by SonarCloud (#44)

This commit is contained in:
Peder Holdgaard Pedersen 2025-03-08 20:21:14 +01:00 • committed by GitHub
commit 967d7a4cc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -169,9 +169,12 @@ public sealed class StdioServerTransport : TransportBase, IServerTransport
{
_logger.TransportCleaningUp(EndpointName);
_shutdownCts?.Cancel();
_shutdownCts?.Dispose();
_shutdownCts = null;
if (_shutdownCts != null)
{
await _shutdownCts.CancelAsync().ConfigureAwait(false);
_shutdownCts.Dispose();
_shutdownCts = null;
}
if (_readTask != null)
{