Avoid an unnecessary panic when the script task deals with a GC after the layout thread is unreachable.

This commit is contained in:
Josh Matthews 2016-06-20 13:23:48 -04:00
parent a7701c9abd
commit 30d8009659

View file

@ -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");
}
}
}