task: fix error awaiting already scheduled task

To reproduce this issue, try `await taskMgr.add(Task.pause(1.0))`
This commit is contained in:
rdb 2019-01-09 20:09:18 +01:00
parent 7262f16ed8
commit e64a342a9f

View File

@ -598,7 +598,9 @@ do_python_task() {
// directly instead of having to do:
// await taskMgr.add(Task.pause(1.0))
AsyncTask *task = (AsyncTask *)fut;
_manager->add(task);
if (!task->is_alive()) {
_manager->add(task);
}
}
if (fut->add_waiting_task(this)) {
if (task_cat.is_debug()) {