diff options
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index a9ebd9eb46c..eb6e267c740 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -2847,6 +2847,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()); |