mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Adds borrow_for_script_deallocation and unsafe_mut_js_info method to avoid '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:
parent
648b4991b9
commit
7b9c902a0a
4 changed files with 17 additions and 10 deletions
|
@ -248,11 +248,13 @@ impl<'a> Drop for ScriptMemoryFailsafe<'a> {
|
|||
fn drop(&mut self) {
|
||||
match self.owner {
|
||||
Some(owner) => {
|
||||
let page = owner.page.borrow_mut();
|
||||
for page in page.iter() {
|
||||
*page.mut_js_info() = None;
|
||||
unsafe {
|
||||
let page = owner.page.borrow_for_script_deallocation();
|
||||
for page in page.iter() {
|
||||
*page.unsafe_mut_js_info() = None;
|
||||
}
|
||||
*owner.js_context.borrow_for_script_deallocation() = None;
|
||||
}
|
||||
*owner.js_context.borrow_mut() = None;
|
||||
}
|
||||
None => (),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue