diff options
author | CYBAI <cyb.ai.815@gmail.com> | 2018-10-21 21:30:19 +0800 |
---|---|---|
committer | CYBAI <cyb.ai.815@gmail.com> | 2018-10-21 21:30:19 +0800 |
commit | bca951d79ed9d356c1a9f5a5f4d1ad5a943a3df2 (patch) | |
tree | e0b1425a084aa975db6affebee27a2fd209a1336 /components/script/dom/bindings/refcounted.rs | |
parent | 2304f02123038a2e729bc90a2e2db9a795f30158 (diff) | |
download | servo-bca951d79ed9d356c1a9f5a5f4d1ad5a943a3df2.tar.gz servo-bca951d79ed9d356c1a9f5a5f4d1ad5a943a3df2.zip |
Drop `TrustedPromise` before dropping JSRuntime
Diffstat (limited to 'components/script/dom/bindings/refcounted.rs')
-rw-r--r-- | components/script/dom/bindings/refcounted.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/components/script/dom/bindings/refcounted.rs b/components/script/dom/bindings/refcounted.rs index 11a422a2f3f..49add72e114 100644 --- a/components/script/dom/bindings/refcounted.rs +++ b/components/script/dom/bindings/refcounted.rs @@ -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(); |