From 1fab2416d7d6036399e3581419252d79a88b8c37 Mon Sep 17 00:00:00 2001 From: Gregory Terzian Date: Thu, 21 Nov 2019 23:55:34 +0800 Subject: [PATCH] abort parser, if any, when pipeline exits --- components/script/script_thread.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index dbc4f0fb444..5a1a91c9b46 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -2876,6 +2876,12 @@ 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();