Skip to content

Commit 5aee24e

Browse files
campersauamaitland
authored andcommitted
Use TrySetCanceled to cancel pending tasks
1 parent 209ad61 commit 5aee24e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CefSharp/Internals/PendingTaskRepository.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,13 @@ public void Dispose()
180180
{
181181
foreach (var tcs in PendingTasks.Values)
182182
{
183-
tcs.SetCanceled();
183+
tcs.TrySetCanceled();
184184
}
185185
PendingTasks.Clear();
186186

187187
foreach (var tcs in CallbackPendingTasks.Values)
188188
{
189-
tcs.SetCanceled();
189+
tcs.TrySetCanceled();
190190
}
191191
CallbackPendingTasks.Clear();
192192
}

0 commit comments

Comments
 (0)