Merge pull request #718 from Demonthos/handle-removing-a-completed-future

Handle removing a future that does not exist
This commit is contained in:
Jon Kelley 2023-01-04 12:49:08 -05:00 committed by GitHub
commit 3393d0487c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -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);
}
}

View file

@ -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);
}
}