Skip to content

Commit

Permalink
Auto merge of #24818 - gterzian:fix_panic_on_finish_load, r=jdm
Browse files Browse the repository at this point in the history
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. -->
  • Loading branch information
bors-servo committed Nov 22, 2019
2 parents c060f00 + f28ffac commit 1b524ea
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/script/script_thread.rs
Expand Up @@ -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());
Expand Down

0 comments on commit 1b524ea

Please sign in to comment.