From 30d80096591d94125e22e388eaef791d2e5bb4d3 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 a3289cca56e..b08fd076a9d 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -202,7 +202,9 @@ impl OpaqueStyleAndLayoutData { debug_assert!(thread_state::get().is_script()); let win = window_from_node(node); node.style_and_layout_data.set(None); - win.layout_chan().send(Msg::ReapStyleAndLayoutData(self)).unwrap(); + if win.layout_chan().send(Msg::ReapStyleAndLayoutData(self)).is_err() { + warn!("layout thread unreachable - leaking layout data"); + } } }