fix: fixes incorrect cancellation

This commit is contained in:
Dimitrie Stefanescu
2021-04-03 18:22:22 +01:00
parent af6b381578
commit 2f2be53bff
2 changed files with 5 additions and 14 deletions
@@ -52,7 +52,7 @@ namespace GrasshopperAsyncComponentDemo.SampleImplementations
public override void DoWork(Action<string, double> ReportProgress, Action Done)
{
// Checking for cancellation
if (CancellationToken.IsCancellationRequested) { Done(); return; }
if (CancellationToken.IsCancellationRequested) { return; }
for (int i = 0; i <= MaxIterations; i++)
{
@@ -63,7 +63,7 @@ namespace GrasshopperAsyncComponentDemo.SampleImplementations
ReportProgress(Id, ((double)(i + 1) / (double)MaxIterations));
// Checking for cancellation
if (CancellationToken.IsCancellationRequested) { Done(); return; }
if (CancellationToken.IsCancellationRequested) { return; }
}
Done();