From 112f1b97a36c9de910ea703e04b3c6878fa216d9 Mon Sep 17 00:00:00 2001 From: Youssef Victor <31348972+Youssef1313@users.noreply.github.com> Date: Thu, 13 Aug 2020 23:37:47 +0200 Subject: [PATCH] Add missing dispose for CancellationTokenSource (#13420) --- .../cimSupport/cmdletization/cim/cimChildJobBase.cs | 1 + .../commands/management/TestConnectionCommand.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimChildJobBase.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimChildJobBase.cs index 3743d1965..f23c74c14 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimChildJobBase.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimChildJobBase.cs @@ -1087,6 +1087,7 @@ namespace Microsoft.PowerShell.Cmdletization.Cim } _cimSensitiveValueConverter.Dispose(); + _cancellationTokenSource.Dispose(); } } } diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs index 94488506e..6875f7a21 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs @@ -838,6 +838,7 @@ namespace Microsoft.PowerShell.Commands if (disposing) { _sender?.Dispose(); + _dnsLookupCancel.Dispose(); } _disposed = true;