mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Don't panic while already panicking in BoxSlot::drop
This commit is contained in:
parent
50bd5c3e0f
commit
f4c4af2bd4
1 changed files with 4 additions and 2 deletions
|
@ -346,8 +346,10 @@ impl BoxSlot<'_> {
|
||||||
|
|
||||||
impl Drop for BoxSlot<'_> {
|
impl Drop for BoxSlot<'_> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
if let Some(slot) = &mut self.slot {
|
if !std::thread::panicking() {
|
||||||
assert!(slot.borrow().is_some(), "failed to set a layout box");
|
if let Some(slot) = &mut self.slot {
|
||||||
|
assert!(slot.borrow().is_some(), "failed to set a layout box");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue