mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
auto merge of #4777 : dmarcos/servo/issue4692, r=jdm
...id 'DOMRefCell already mutably borrowed' messages. This is just a temporary fix until the Rust standard library allows borrowing already-borrowed RefCell values during unwinding. It also removes LiveDOMReferences destructor that it's a no-op but it contains an assert that was being violated causing an endless cycle of destructor calls ending up in a stack overflow.
This commit is contained in:
commit
a7e29939a1
4 changed files with 17 additions and 10 deletions
|
@ -41,6 +41,13 @@ impl<T> DOMRefCell<T> {
|
|||
&*self.value.as_unsafe_cell().get()
|
||||
}
|
||||
|
||||
/// Borrow the contents for the purpose of script deallocation.
|
||||
///
|
||||
pub unsafe fn borrow_for_script_deallocation<'a>(&'a self) -> &'a mut T {
|
||||
debug_assert!(task_state::get().contains(SCRIPT));
|
||||
&mut *self.value.as_unsafe_cell().get()
|
||||
}
|
||||
|
||||
/// Is the cell mutably borrowed?
|
||||
///
|
||||
/// For safety checks in debug builds only.
|
||||
|
|
|
@ -188,9 +188,3 @@ impl LiveDOMReferences {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for LiveDOMReferences {
|
||||
fn drop(&mut self) {
|
||||
assert!(self.table.borrow().keys().count() == 0);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue