From 623936c7b8842c949ab15ba96303537d52672549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8F=E3=81=99=E3=81=AF?= Date: Fri, 24 Apr 2020 12:32:58 +0900 Subject: [PATCH] Fix timeoutTask continues to remain. --- Assets/UniRx.Async/UniTaskExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/UniRx.Async/UniTaskExtensions.cs b/Assets/UniRx.Async/UniTaskExtensions.cs index 06642df..2ec68dc 100644 --- a/Assets/UniRx.Async/UniTaskExtensions.cs +++ b/Assets/UniRx.Async/UniTaskExtensions.cs @@ -101,7 +101,7 @@ namespace UniRx.Async // left, right both suppress operation canceled exception. var delayCancellationTokenSource = new CancellationTokenSource(); - var timeoutTask = (UniTask)UniTask.Delay(timeout, ignoreTimeScale, timeoutCheckTiming).SuppressCancellationThrow(); + var timeoutTask = (UniTask)UniTask.Delay(timeout, ignoreTimeScale, timeoutCheckTiming, delayCancellationTokenSource.Token).SuppressCancellationThrow(); var (hasValue, value) = await UniTask.WhenAny(task.SuppressCancellationThrow(), timeoutTask); @@ -147,7 +147,7 @@ namespace UniRx.Async // left, right both suppress operation canceled exception. var delayCancellationTokenSource = new CancellationTokenSource(); - var timeoutTask = (UniTask)UniTask.Delay(timeout, ignoreTimeScale, timeoutCheckTiming).SuppressCancellationThrow(); + var timeoutTask = (UniTask)UniTask.Delay(timeout, ignoreTimeScale, timeoutCheckTiming, delayCancellationTokenSource.Token).SuppressCancellationThrow(); var (hasValue, value) = await UniTask.WhenAny(task.SuppressCancellationThrow(), timeoutTask);