mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 07:48:37 -04:00
task: Prevent "unexpected task state" when cancelling task sometimes
This commit is contained in:
parent
55fb14b792
commit
91a6ff1d81
@ -315,6 +315,11 @@ wake_task(AsyncTask *task) {
|
||||
task->_state = AsyncTask::S_servicing;
|
||||
return;
|
||||
|
||||
case AsyncTask::S_active:
|
||||
// It could have already been activated, such as by a cancel() which then
|
||||
// indirectly caused the awaiting future to be cancelled. Do nothing.
|
||||
return;
|
||||
|
||||
case AsyncTask::S_inactive:
|
||||
// Schedule it immediately.
|
||||
nassertv(task->_manager == nullptr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user