set the scope stack correctly

This commit is contained in:
Evan Almloff committed 2023-08-04 14:19:59 -07:00
1 parent b09e528aaa
commit a2c7b69a1d
4 files changed
+9 -9

No files matched your search

+6 -1
View File
@@ -46,6 +46,7 @@ impl VirtualDom {
}
pub(crate) fn run_scope(&mut self, scope_id: ScopeId) -> &RenderReturn {
self.runtime.scope_stack.borrow_mut().push(scope_id);
// Cycle to the next frame and then reset it
// This breaks any latent references, invalidating every pointer referencing into it.
// Remove all the outdated listeners
@@ -94,6 +95,10 @@ impl VirtualDom {
}
// rebind the lifetime now that its stored internally
unsafe { allocated.extend_lifetime_ref() }
let result = unsafe { allocated.extend_lifetime_ref() };
self.runtime.scope_stack.borrow_mut().pop();
result
}
}