Fix rare async task crash when it's canceled while dequeuing

This commit is contained in:
Wojtek Figat
2026-01-30 13:14:36 +01:00
parent e4eb064562
commit d18c245730

View File

@@ -148,9 +148,8 @@ Task* Task::StartNew(Function<bool()>::Signature& action, Object* target)
void Task::Execute()
{
if (IsCanceled())
if (!IsQueued())
return;
ASSERT(IsQueued());
SetState(TaskState::Running);
// Perform an operation