remove messagaging and worker infra on workerscope exits

This commit is contained in:
Gregory Terzian 2020-05-29 23:08:46 +08:00
parent 6f34b52e39
commit f4d258d674

View file

@ -161,7 +161,12 @@ impl WorkerGlobalScope {
}
}
/// Clear various items when the worker event-loop shuts-down.
pub fn clear_js_runtime(&self) {
self.upcast::<GlobalScope>()
.remove_web_messaging_and_dedicated_workers_infra();
// Drop the runtime.
let runtime = self.runtime.borrow_mut().take();
drop(runtime);
}