aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authorGlenn Watson <gw@intuitionlibrary.com>2015-05-20 07:55:22 +1000
committerGlenn Watson <gw@intuitionlibrary.com>2015-05-20 07:55:22 +1000
commit23b18a841714a4dc8931fda0f73014699d2cbbbe (patch)
treec72cea2dca49a405350b0c618efecbf88c013623 /components/script
parentdecfb0da6edec9857c304932f3c6fa5ca23b8f07 (diff)
downloadservo-23b18a841714a4dc8931fda0f73014699d2cbbbe.tar.gz
servo-23b18a841714a4dc8931fda0f73014699d2cbbbe.zip
Handle case where a page fetch completes after pipeline exits.
Diffstat (limited to 'components/script')
-rw-r--r--components/script/script_task.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs
index fcc0615213a..0a9d97b4540 100644
--- a/components/script/script_task.rs
+++ b/components/script/script_task.rs
@@ -1062,12 +1062,15 @@ impl ScriptTask {
/// Kick off the document and frame tree creation process using the result.
fn handle_page_fetch_complete(&self, id: PipelineId, subpage: Option<SubpageId>,
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| {
load.pipeline_id == id && load.parent_info.map(|info| info.1) == subpage
- }).unwrap();
- let load = self.incomplete_loads.borrow_mut().remove(idx);
- self.load(response, load);
+ });
+ // 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);
+ self.load(response, load);
+ }
}
/// Handles a request for the window title.