diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-11-22 03:12:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-22 03:12:59 -0500 |
commit | 1b524ead1e2626fe0152e049f634f8705ee187e2 (patch) | |
tree | b8db51f03b1b2dc09eabb30e4e3adf5f8f92d4f1 /components/script/script_thread.rs | |
parent | c060f005354f6524e726cccab2bff065bd18cbc1 (diff) | |
parent | f28ffaca596712bf4a260a0dc41bf1691baf1dbc (diff) | |
download | servo-1b524ead1e2626fe0152e049f634f8705ee187e2.tar.gz servo-1b524ead1e2626fe0152e049f634f8705ee187e2.zip |
Auto merge of #24818 - gterzian:fix_panic_on_finish_load, r=jdm
Prevent panic on layout send in finish-load
<!-- Please describe your changes on the following line: -->
Do not run the finish load steps if the pipeline has been discarded by the time the parser finishes.
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #22955 (GitHub issue number if applicable)
<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
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()); |