diff options
Diffstat (limited to 'components')
-rw-r--r-- | components/script/dom/bindings/refcounted.rs | 6 | ||||
-rw-r--r-- | components/script/script_runtime.rs | 5 |
2 files changed, 10 insertions, 1 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(); diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs index 18138dcc2b0..865382f091f 100644 --- a/components/script/script_runtime.rs +++ b/components/script/script_runtime.rs @@ -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); + }); } } |