mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +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)]
|
||||
fn addref_promise(&self, promise: Rc<Promise>) {
|
||||
let mut table = self.promise_table.borrow_mut();
|
||||
|
|
|
@ -145,7 +145,10 @@ pub struct Runtime(RustRuntime);
|
|||
|
||||
impl Drop for Runtime {
|
||||
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