Skip to content

Commit 276336b

Browse files
committed
disposes cancellation token source
Ensures the cancellation token source is disposed when the console cancels.
1 parent 2c513f9 commit 276336b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

new-cli/GitVersion.Core.Tester/Program.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
};
1212

1313
var cts = new CancellationTokenSource();
14-
Console.CancelKeyPress += (_, _) => cts.Cancel();
14+
Console.CancelKeyPress += (_, _) =>
15+
{
16+
cts.Cancel();
17+
cts.Dispose();
18+
};
1519

1620
await using var serviceProvider = RegisterModules(modules);
1721
var app = serviceProvider.GetRequiredService<ICliApp>();

0 commit comments

Comments
 (0)