This commit is contained in:
CortexCore
2025-01-23 11:39:53 +08:00
parent 000a079985
commit 57e24939fb
7 changed files with 52 additions and 18 deletions

View File

@@ -64,8 +64,11 @@ namespace BITKit.StateMachine
if(_cancellationTokenSource.IsCancellationRequested)return;
if (CurrentState is null) return;
using var _ = IsBusy.GetHandle();
if (CurrentState is not null)
{
CurrentState.Enabled = false;
}
await CurrentState.OnStateExitAsync(CurrentState, null);
if(_cancellationTokenSource.IsCancellationRequested)return;
CurrentState.OnStateExit(CurrentState, null);
CurrentState = null;
}