Fix timeoutTask continues to remain.

pull/65/head
くすは 2020-04-24 12:32:58 +09:00
parent b4ec35aadd
commit 623936c7b8
1 changed files with 2 additions and 2 deletions

View File

@ -101,7 +101,7 @@ namespace UniRx.Async
// left, right both suppress operation canceled exception. // left, right both suppress operation canceled exception.
var delayCancellationTokenSource = new CancellationTokenSource(); 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); var (hasValue, value) = await UniTask.WhenAny(task.SuppressCancellationThrow(), timeoutTask);
@ -147,7 +147,7 @@ namespace UniRx.Async
// left, right both suppress operation canceled exception. // left, right both suppress operation canceled exception.
var delayCancellationTokenSource = new CancellationTokenSource(); 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); var (hasValue, value) = await UniTask.WhenAny(task.SuppressCancellationThrow(), timeoutTask);