mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Handle case where a page fetch completes after pipeline exits.
This commit is contained in:
parent
decfb0da6e
commit
23b18a8417
1 changed files with 7 additions and 4 deletions
|
@ -1062,13 +1062,16 @@ impl ScriptTask {
|
||||||
/// Kick off the document and frame tree creation process using the result.
|
/// Kick off the document and frame tree creation process using the result.
|
||||||
fn handle_page_fetch_complete(&self, id: PipelineId, subpage: Option<SubpageId>,
|
fn handle_page_fetch_complete(&self, id: PipelineId, subpage: Option<SubpageId>,
|
||||||
response: LoadResponse) {
|
response: LoadResponse) {
|
||||||
// Any notification received should refer to an existing, in-progress load that is tracked.
|
|
||||||
let idx = self.incomplete_loads.borrow().iter().position(|load| {
|
let idx = self.incomplete_loads.borrow().iter().position(|load| {
|
||||||
load.pipeline_id == id && load.parent_info.map(|info| info.1) == subpage
|
load.pipeline_id == id && load.parent_info.map(|info| info.1) == subpage
|
||||||
}).unwrap();
|
});
|
||||||
|
// The matching in progress load structure may not exist if
|
||||||
|
// the pipeline exited before the page load completed.
|
||||||
|
if let Some(idx) = idx {
|
||||||
let load = self.incomplete_loads.borrow_mut().remove(idx);
|
let load = self.incomplete_loads.borrow_mut().remove(idx);
|
||||||
self.load(response, load);
|
self.load(response, load);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Handles a request for the window title.
|
/// Handles a request for the window title.
|
||||||
fn handle_get_title_msg(&self, pipeline_id: PipelineId) {
|
fn handle_get_title_msg(&self, pipeline_id: PipelineId) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue