Merge pull request #115 from IllusionCui/master

[addressable]:fix CancellationToken can't stop UniTask #114
master
Yoshifumi Kawai 2020-07-16 05:37:01 +09:00 committed by GitHub
commit 009715c0da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -152,7 +152,11 @@ namespace Cysharp.Threading.Tasks
else
{
completed = true;
if (handle.Status == AsyncOperationStatus.Failed)
if (cancellationToken.IsCancellationRequested)
{
core.TrySetCanceled(cancellationToken);
}
else if (handle.Status == AsyncOperationStatus.Failed)
{
core.TrySetException(handle.OperationException);
}
@ -465,7 +469,11 @@ namespace Cysharp.Threading.Tasks
else
{
completed = true;
if (handle.Status == AsyncOperationStatus.Failed)
if (cancellationToken.IsCancellationRequested)
{
core.TrySetCanceled(cancellationToken);
}
else if (handle.Status == AsyncOperationStatus.Failed)
{
core.TrySetException(handle.OperationException);
}