diff --git a/packages/core/src/scheduler/task.rs b/packages/core/src/scheduler/task.rs index 39c770a06..997953f8e 100644 --- a/packages/core/src/scheduler/task.rs +++ b/packages/core/src/scheduler/task.rs @@ -59,9 +59,9 @@ impl Scheduler { /// Drop the future with the given TaskId /// - /// This does nto abort the task, so you'll want to wrap it in an aborthandle if that's important to you + /// This does not abort the task, so you'll want to wrap it in an aborthandle if that's important to you pub fn remove(&self, id: TaskId) { - self.tasks.borrow_mut().remove(id.0); + self.tasks.borrow_mut().try_remove(id.0); } } diff --git a/packages/core/src/scheduler/wait.rs b/packages/core/src/scheduler/wait.rs index 9268cfeb0..8ec1776c2 100644 --- a/packages/core/src/scheduler/wait.rs +++ b/packages/core/src/scheduler/wait.rs @@ -34,7 +34,7 @@ impl VirtualDom { self.scopes[task.scope.0].spawned_tasks.remove(&id); // Remove it from the scheduler - tasks.remove(id.0); + tasks.try_remove(id.0); } }