From bca951d79ed9d356c1a9f5a5f4d1ad5a943a3df2 Mon Sep 17 00:00:00 2001 From: CYBAI Date: Sun, 21 Oct 2018 21:30:19 +0800 Subject: Drop `TrustedPromise` before dropping JSRuntime --- components/script/dom/bindings/refcounted.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'components/script/dom/bindings/refcounted.rs') 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) { let mut table = self.promise_table.borrow_mut(); -- cgit v1.2.3