mirror of
https://github.com/Cysharp/UniTask.git
synced 2026-05-18 05:00:14 +00:00
Fixed a bug in Dotween after returning to the pool of CancellationToken.Register
This commit is contained in:
@@ -148,6 +148,7 @@ namespace Cysharp.Threading.Tasks
|
|||||||
Tween tween;
|
Tween tween;
|
||||||
TweenCancelBehaviour cancelBehaviour;
|
TweenCancelBehaviour cancelBehaviour;
|
||||||
CancellationToken cancellationToken;
|
CancellationToken cancellationToken;
|
||||||
|
CancellationTokenRegistration cancellationRegistration;
|
||||||
CallbackType callbackType;
|
CallbackType callbackType;
|
||||||
bool canceled;
|
bool canceled;
|
||||||
|
|
||||||
@@ -215,7 +216,7 @@ namespace Cysharp.Threading.Tasks
|
|||||||
|
|
||||||
if (cancellationToken.CanBeCanceled)
|
if (cancellationToken.CanBeCanceled)
|
||||||
{
|
{
|
||||||
cancellationToken.RegisterWithoutCaptureExecutionContext(x =>
|
result.cancellationRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(x =>
|
||||||
{
|
{
|
||||||
var source = (TweenConfiguredSource)x;
|
var source = (TweenConfiguredSource)x;
|
||||||
switch (source.cancelBehaviour)
|
switch (source.cancelBehaviour)
|
||||||
@@ -376,6 +377,7 @@ namespace Cysharp.Threading.Tasks
|
|||||||
{
|
{
|
||||||
TaskTracker.RemoveTracking(this);
|
TaskTracker.RemoveTracking(this);
|
||||||
core.Reset();
|
core.Reset();
|
||||||
|
cancellationRegistration.Dispose();
|
||||||
|
|
||||||
switch (callbackType)
|
switch (callbackType)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user