aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_task.rs
diff options
context:
space:
mode:
authorGlenn Watson <gw@intuitionlibrary.com>2015-04-29 09:13:46 +1000
committerGlenn Watson <gw@intuitionlibrary.com>2015-05-14 11:42:54 +1000
commit2b3737d34e0d49af1143fa09f2043cd9375cea8d (patch)
tree8f2aedd93bdf00f8179f6456e56d1bccd0353726 /components/script/script_task.rs
parent5e61ebaa05e5babb7b2fdd1347b6cdd23df38e62 (diff)
downloadservo-2b3737d34e0d49af1143fa09f2043cd9375cea8d.tar.gz
servo-2b3737d34e0d49af1143fa09f2043cd9375cea8d.zip
Various fixes for cleaning up iframes, compositor layers, pipelines and threads.
This allows most of the jquery test suite to run without exhausting thread resources.
Diffstat (limited to 'components/script/script_task.rs')
-rw-r--r--components/script/script_task.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs
index c88dbb8537a..c9d92497a04 100644
--- a/components/script/script_task.rs
+++ b/components/script/script_task.rs
@@ -1078,6 +1078,13 @@ impl ScriptTask {
/// Handles a request to exit the script task and shut down layout.
/// Returns true if the script task should shut down and false otherwise.
fn handle_exit_pipeline_msg(&self, id: PipelineId, exit_type: PipelineExitType) -> bool {
+ if self.page.borrow().is_none() {
+ // The root page doesn't even exist yet, so it
+ // is safe to exit this script task.
+ // TODO(gw): This probably leaks resources!
+ return true;
+ }
+
// If root is being exited, shut down all pages
let page = self.root_page();
let window = page.window().root();
@@ -1452,7 +1459,11 @@ impl ScriptTask {
}, LoadConsumer::Channel(input_chan))).unwrap();
let load_response = input_port.recv().unwrap();
- script_chan.send(ScriptMsg::PageFetchComplete(id, subpage, load_response)).unwrap();
+ if script_chan.send(ScriptMsg::PageFetchComplete(id, subpage, load_response)).is_err() {
+ // TODO(gw): This should be handled by aborting
+ // the load before the script task exits.
+ debug!("PageFetchComplete: script channel has exited");
+ }
});
self.incomplete_loads.borrow_mut().push(incomplete);