From a74ce64539e29cfef96d03e87490c9454b61f3e1 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 20 Jun 2016 13:23:48 -0400 Subject: [PATCH] Avoid an unnecessary panic when the script task deals with a GC after the layout thread is unreachable. --- components/script/dom/node.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 53a3f355b9d..ec370dff293 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -192,7 +192,9 @@ impl Node { debug_assert!(thread_state::get().is_script()); let win = window_from_node(self); self.style_and_layout_data.set(None); - win.layout_chan().send(Msg::ReapStyleAndLayoutData(data)).unwrap(); + if win.layout_chan().send(Msg::ReapStyleAndLayoutData(data)).is_err() { + warn!("layout thread unreachable - leaking layout data"); + } } /// Adds a new child to the end of this node's list of children.