aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/refcounted.rs
diff options
context:
space:
mode:
authorCYBAI <cyb.ai.815@gmail.com>2018-10-21 21:30:19 +0800
committerCYBAI <cyb.ai.815@gmail.com>2018-10-21 21:30:19 +0800
commitbca951d79ed9d356c1a9f5a5f4d1ad5a943a3df2 (patch)
treee0b1425a084aa975db6affebee27a2fd209a1336 /components/script/dom/bindings/refcounted.rs
parent2304f02123038a2e729bc90a2e2db9a795f30158 (diff)
downloadservo-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.rs6
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();