Skip to content

Commit 9926944

Browse files
Don't cancel on disposal of CancellationScope (#1776)
This eliminates an extra cancellation on tokens that are getting disposed.
1 parent e39613b commit 9926944

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/PowerShellEditorServices/Services/PowerShell/Utility/CancellationContext.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation.
1+
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

44
using System;
@@ -109,8 +109,10 @@ internal CancellationScope(
109109

110110
public void Dispose()
111111
{
112+
// TODO: This is whack. It used to call `Cancel` on the cancellation source, but we
113+
// shouldn't do that!
114+
_cancellationSource.Dispose();
112115
_cancellationStack.TryPop(out CancellationScope _);
113-
_cancellationSource.Cancel();
114116
}
115117
}
116118
}

0 commit comments

Comments
 (0)