mirror of https://github.com/Cysharp/UniTask
Fixed bug with OnKill delegate overriding
parent
5e266f5538
commit
03ef341096
|
@ -105,7 +105,7 @@ namespace Cysharp.Threading.Tasks
|
|||
|
||||
if (!tween.IsActive()) return UniTask.CompletedTask;
|
||||
|
||||
var registration = cancellationToken.Register(() =>
|
||||
using var registration = cancellationToken.Register(() =>
|
||||
{
|
||||
if (tween.IsActive())
|
||||
{
|
||||
|
@ -113,8 +113,6 @@ namespace Cysharp.Threading.Tasks
|
|||
}
|
||||
});
|
||||
|
||||
tween.OnKill((() => registration.Dispose()));
|
||||
|
||||
return tween.ToUniTask(TweenCancelBehaviour.KillAndCancelAwait, cancellationToken);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue