diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-02-08 08:51:43 -0700 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-02-08 08:51:43 -0700 |
commit | 13b49ddf446871e7c544bd0b5d6457168c84de46 (patch) | |
tree | eb903a9824edfc00132e934a73eae3705b336693 /components/script/script_task.rs | |
parent | aa5fecec5b2e7052891873f95f0d7bca5afb62a9 (diff) | |
parent | 5ef9eaa1e1653a2eda62388fc47e932e6fdda254 (diff) | |
download | servo-13b49ddf446871e7c544bd0b5d6457168c84de46.tar.gz servo-13b49ddf446871e7c544bd0b5d6457168c84de46.zip |
auto merge of #4859 : glennw/servo/fix-3986, r=larsbergstrom
Diffstat (limited to 'components/script/script_task.rs')
-rw-r--r-- | components/script/script_task.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs index 0c0377adf28..0f3f5c1b564 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -753,9 +753,10 @@ impl ScriptTask { } // otherwise find just the matching page and exit all sub-pages - match page.remove(id) { + match page.find(id) { Some(ref mut page) => { shut_down_layout(&*page, (*self.js_runtime).ptr, exit_type); + page.remove(id); false } // TODO(tkuehn): pipeline closing is currently duplicated across @@ -1321,8 +1322,9 @@ fn shut_down_layout(page_tree: &Rc<Page>, rt: *mut JSRuntime, exit_type: Pipelin // processed this message. let (response_chan, response_port) = channel(); let LayoutChan(ref chan) = page.layout_chan; - chan.send(layout_interface::Msg::PrepareToExit(response_chan)).unwrap(); - response_port.recv().unwrap(); + if chan.send(layout_interface::Msg::PrepareToExit(response_chan)).is_ok() { + response_port.recv().unwrap(); + } } // Remove our references to the DOM objects in this page tree. @@ -1344,7 +1346,7 @@ fn shut_down_layout(page_tree: &Rc<Page>, rt: *mut JSRuntime, exit_type: Pipelin // Destroy the layout task. If there were node leaks, layout will now crash safely. for page in page_tree.iter() { let LayoutChan(ref chan) = page.layout_chan; - chan.send(layout_interface::Msg::ExitNow(exit_type)).unwrap(); + chan.send(layout_interface::Msg::ExitNow(exit_type)).ok(); } } |