Skip to content

Commit

Permalink
Comment warning regarding not-awaited delay task
Browse files Browse the repository at this point in the history
  • Loading branch information
episource committed Jan 6, 2025
1 parent d130359 commit 3bdfe53
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions EpiSource.KeePass.Ekf/UI/SmartcardOperationDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,12 @@ private static async Task<InvocationResult<TTarget, TReturn>> DoCryptoImpl<TTarg

if (showDialogDelay.HasValue) {
// Prevent flicker for very short running tasks: Show dialog only for longer running tasks
// note: not waiting for this task, but finally blocks ensures the task is cancelled reliably
#pragma warning disable CS4014
Task.Delay(showDialogDelay.Value, cts.Token)
.ContinueWith(t => scOperationDialog.Show(activeForm), cts.Token,
TaskContinuationOptions.RunContinuationsAsynchronously, TaskScheduler.FromCurrentSynchronizationContext());
#pragma warning restore CS4014
} else {
scOperationDialog.Show(activeForm);
}
Expand Down

0 comments on commit 3bdfe53

Please sign in to comment.