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 fbf6c7fc2b
commit a74ce64539

View file

@ -192,7 +192,9 @@ impl Node {
debug_assert!(thread_state::get().is_script()); debug_assert!(thread_state::get().is_script());
let win = window_from_node(self); let win = window_from_node(self);
self.style_and_layout_data.set(None); 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. /// Adds a new child to the end of this node's list of children.