diff options
author | Gregory Terzian <gterzian@users.noreply.github.com> | 2019-11-22 14:45:23 +0800 |
---|---|---|
committer | Gregory Terzian <gterzian@users.noreply.github.com> | 2019-11-22 14:45:23 +0800 |
commit | f28ffaca596712bf4a260a0dc41bf1691baf1dbc (patch) | |
tree | 7814ee94e0145c9209365dc96bc463d6d8cdda21 /components/script | |
parent | 1fab2416d7d6036399e3581419252d79a88b8c37 (diff) | |
download | servo-f28ffaca596712bf4a260a0dc41bf1691baf1dbc.tar.gz servo-f28ffaca596712bf4a260a0dc41bf1691baf1dbc.zip |
abort parser before shutting down layout in exit pipeline
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/script_thread.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 5a1a91c9b46..55696c6a389 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -2840,6 +2840,14 @@ impl ScriptThread { 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, // but also has a Document. 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, // to avoid running layout on detached iframes. let window = document.window(); |