Skip to content
Permalink
Browse files

abort parser before shutting down layout in exit pipeline

  • Loading branch information
gterzian committed Nov 22, 2019
1 parent 1fab241 commit f28ffaca596712bf4a260a0dc41bf1691baf1dbc
Showing with 8 additions and 6 deletions.
  1. +8 −6 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();

0 comments on commit f28ffac

Please sign in to comment.
You can’t perform that action at this time.