Merge pull request #140 from hikarin522/patch-1

Fix ToCancellationToken
master
Yoshifumi Kawai 2020-08-25 07:13:56 +09:00 committed by GitHub
commit 5e5b8aff89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -30,10 +30,10 @@ namespace Cysharp.Threading.Tasks
return ToCancellationToken(task);
}
var cts = new CancellationTokenSource();
var cts = CancellationTokenSource.CreateLinkedTokenSource(linkToken);
ToCancellationTokenCore(task, cts).Forget();
return CancellationTokenSource.CreateLinkedTokenSource(linkToken).Token;
return cts.Token;
}
public static CancellationToken ToCancellationToken<T>(this UniTask<T> task)