mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Script: ensure child JS runtimes are dropped before parent (#30896)
* clear js runtime of dedicated worker that immediately exits * dedicated worker: clear js runtime if loading script fails * when the script thread crashes, deallocate worker runtimes before dropping main runtime * clear runtime if service worker script fails to load * ensure worker enter their realm before executing script
This commit is contained in:
parent
2f6f03a3b5
commit
90a9300f69
3 changed files with 13 additions and 4 deletions
|
@ -443,6 +443,7 @@ impl DedicatedWorkerGlobalScope {
|
|||
TaskSourceName::DOMManipulation,
|
||||
))
|
||||
.unwrap();
|
||||
scope.clear_js_runtime(context_for_interrupt);
|
||||
return;
|
||||
},
|
||||
Ok((metadata, bytes)) => (metadata, bytes),
|
||||
|
@ -457,11 +458,13 @@ impl DedicatedWorkerGlobalScope {
|
|||
}
|
||||
|
||||
if scope.is_closing() {
|
||||
scope.clear_js_runtime(context_for_interrupt);
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
let _ar = AutoWorkerReset::new(&global, worker.clone());
|
||||
let _ac = enter_realm(&*scope);
|
||||
scope.execute_script(DOMString::from(source));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue