fix: dont handle wakeups from finished tasks

This commit is contained in:
Jonathan Kelley committed 2022-12-17 02:51:13 -08:00
1 parent 482ae5e395
commit a42660a451
1 file changed
+5 -1
+5 -1
View File
@@ -19,7 +19,11 @@ impl VirtualDom {
/// queue
pub(crate) fn handle_task_wakeup(&mut self, id: TaskId) {
let mut tasks = self.scheduler.tasks.borrow_mut();
let task = &tasks[id.0];
let task = match tasks.get(id.0) {
Some(task) => task,
None => return,
};
let waker = task.waker();
let mut cx = Context::from_waker(&waker);