run hook destructors inside of the scope they were created in

This commit is contained in:
Evan Almloff committed 2024-01-22 09:32:53 -06:00
1 parent e5a11aa2a5
commit cdf25f0c14
3 files changed
+22 -15

No files matched your search

-11
View File
@@ -300,17 +300,6 @@ impl ScopeContext {
}
}
impl Drop for ScopeContext {
fn drop(&mut self) {
// Drop all spawned tasks
_ = Runtime::with(|rt| {
for id in self.spawned_tasks.borrow().iter() {
rt.remove_task(*id);
}
})
}
}
impl ScopeId {
/// Get the current scope id
pub fn current_scope_id(self) -> Option<ScopeId> {