Resolve issue with scope disposal panicking because it can't find runtime (because runtime already dropped)

This commit is contained in:
Greg Johnston 2022-12-12 10:25:20 -05:00
parent 4a1d16b641
commit 9c0d813697

View file

@ -75,15 +75,7 @@ impl RuntimeId {
cfg_if! {
if #[cfg(not(any(feature = "csr", feature = "hydrate")))] {
let runtime = RUNTIMES.with(move |runtimes| runtimes.borrow_mut().remove(self));
if let Some(runtime) = runtime {
for (scope_id, _) in runtime.scopes.borrow().iter() {
let scope = Scope {
runtime: self,
id: scope_id,
};
scope.dispose();
}
}
drop(runtime);
}
}
}