fix scope context

This commit is contained in:
Evan Almloff committed 2023-08-04 14:12:59 -07:00
1 parent 04cdb14e5b
commit cb4c46154d
7 files changed
+83 -45

No files matched your search

+6 -4
View File
@@ -110,11 +110,13 @@ impl VirtualDom {
// Drop all the hooks once the children are dropped
// this means we'll drop hooks bottom-up
scope.hooks.get_mut().clear();
let context = scope.context();
{
let context = scope.context();
// Drop all the futures once the hooks are dropped
for task_id in context.spawned_tasks.borrow_mut().drain() {
context.tasks.remove(task_id);
// Drop all the futures once the hooks are dropped
for task_id in context.spawned_tasks.borrow_mut().drain() {
context.tasks.remove(task_id);
}
}
self.scopes.remove(id.0);