mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
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. -->
This commit is contained in:
commit
1b524ead1e
1 changed files with 8 additions and 0 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue