mirror of
https://github.com/servo/servo.git
synced 2025-06-08 00:23:30 +00:00
abort parser before shutting down layout in exit pipeline
This commit is contained in:
parent
1fab2416d7
commit
f28ffaca59
1 changed files with 8 additions and 6 deletions
|
@ -2840,6 +2840,14 @@ impl ScriptThread {
|
||||||
|
|
||||||
let document = self.documents.borrow_mut().remove(id);
|
let document = self.documents.borrow_mut().remove(id);
|
||||||
|
|
||||||
|
// Abort the parser, if any,
|
||||||
|
// to prevent any further incoming networking messages from being handled.
|
||||||
|
if let Some(document) = document.as_ref() {
|
||||||
|
if let Some(parser) = document.get_current_parser() {
|
||||||
|
parser.abort();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// We should never have a pipeline that's still an incomplete load,
|
// We should never have a pipeline that's still an incomplete load,
|
||||||
// but also has a Document.
|
// but also has a Document.
|
||||||
debug_assert!(idx.is_none() || document.is_none());
|
debug_assert!(idx.is_none() || document.is_none());
|
||||||
|
@ -2876,12 +2884,6 @@ impl ScriptThread {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Abort the parser, if any,
|
|
||||||
// to prevent any further incoming networking messages from being handled.
|
|
||||||
if let Some(parser) = document.get_current_parser() {
|
|
||||||
parser.abort();
|
|
||||||
}
|
|
||||||
|
|
||||||
// We discard the browsing context after requesting layout shut down,
|
// We discard the browsing context after requesting layout shut down,
|
||||||
// to avoid running layout on detached iframes.
|
// to avoid running layout on detached iframes.
|
||||||
let window = document.window();
|
let window = document.window();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue