fix: remove task id from scope when success
This commit is contained in:
1 parent
814235f145
commit
3cbf8ed6fa
1 file changed
+3
-4
@@ -1000,12 +1000,11 @@ impl TaskQueue {
|
|||||||
fn remove(&self, id: TaskId) {
|
fn remove(&self, id: TaskId) {
|
||||||
if let Ok(mut tasks) = self.tasks.try_borrow_mut() {
|
if let Ok(mut tasks) = self.tasks.try_borrow_mut() {
|
||||||
let _ = tasks.remove(&id);
|
let _ = tasks.remove(&id);
|
||||||
|
if let Some(task_map) = self.task_map.borrow_mut().get_mut(&id.scope) {
|
||||||
|
task_map.remove(&id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// the task map is still around, but it'll be removed when the scope is unmounted
|
// the task map is still around, but it'll be removed when the scope is unmounted
|
||||||
if let Some(task_map) = self.task_map.borrow_mut().get_mut(&id.scope) {
|
|
||||||
task_map.remove(&id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn has_tasks(&self) -> bool {
|
pub(crate) fn has_tasks(&self) -> bool {
|
||||||
|
|||||||
Reference in new issue
Block a user