Fix rare async task crash when it's canceled while dequeuing
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user