Skip to content

Commit

Permalink
Don't panic while already panicking in BoxSlot::drop
Browse files Browse the repository at this point in the history
  • Loading branch information
nox committed May 18, 2020
1 parent 50bd5c3 commit f4c4af2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/layout_2020/dom_traversal.rs
Expand Up @@ -346,8 +346,10 @@ impl BoxSlot<'_> {

impl Drop for BoxSlot<'_> {
fn drop(&mut self) {
if let Some(slot) = &mut self.slot {
assert!(slot.borrow().is_some(), "failed to set a layout box");
if !std::thread::panicking() {
if let Some(slot) = &mut self.slot {
assert!(slot.borrow().is_some(), "failed to set a layout box");
}
}
}
}
Expand Down

0 comments on commit f4c4af2

Please sign in to comment.