diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/CancellationTokenExtensions.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/CancellationTokenExtensions.cs index 6575432..3f3a532 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/CancellationTokenExtensions.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/CancellationTokenExtensions.cs @@ -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(cts.Token, linkToken).Token; + return cts.Token; } public static CancellationToken ToCancellationToken(this UniTask task)