mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Drop TrustedPromise
before dropping JSRuntime
This commit is contained in:
parent
2304f02123
commit
bca951d79e
2 changed files with 10 additions and 1 deletions
|
@ -224,6 +224,12 @@ impl LiveDOMReferences {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn destruct() {
|
||||||
|
LIVE_REFERENCES.with(|ref r| {
|
||||||
|
*r.borrow_mut() = None;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
#[allow(unrooted_must_root)]
|
||||||
fn addref_promise(&self, promise: Rc<Promise>) {
|
fn addref_promise(&self, promise: Rc<Promise>) {
|
||||||
let mut table = self.promise_table.borrow_mut();
|
let mut table = self.promise_table.borrow_mut();
|
||||||
|
|
|
@ -145,7 +145,10 @@ pub struct Runtime(RustRuntime);
|
||||||
|
|
||||||
impl Drop for Runtime {
|
impl Drop for Runtime {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
THREAD_ACTIVE.with(|t| t.set(false));
|
THREAD_ACTIVE.with(|t| {
|
||||||
|
LiveDOMReferences::destruct();
|
||||||
|
t.set(false);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue