Fix cancellation token forwarding at FirstValueToUniTaskObserver and ToUniTaskObserver;

master
Evgeny Chasovitin 2022-10-11 23:01:19 +04:00
parent e999268305
commit 4a72ec2a1a
1 changed files with 2 additions and 2 deletions

View File

@ -133,7 +133,7 @@ namespace Cysharp.Threading.Tasks
{ {
var self = (ToUniTaskObserver<T>)state; var self = (ToUniTaskObserver<T>)state;
self.disposable.Dispose(); self.disposable.Dispose();
self.promise.TrySetCanceled(); self.promise.TrySetCanceled(self.cancellationToken);
} }
public void OnNext(T value) public void OnNext(T value)
@ -203,7 +203,7 @@ namespace Cysharp.Threading.Tasks
{ {
var self = (FirstValueToUniTaskObserver<T>)state; var self = (FirstValueToUniTaskObserver<T>)state;
self.disposable.Dispose(); self.disposable.Dispose();
self.promise.TrySetCanceled(); self.promise.TrySetCanceled(self.cancellationToken);
} }
public void OnNext(T value) public void OnNext(T value)