mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Separate disposing of layout data from the GCing of the DOM object reflectors. Change the order of operations when shutting down the script task to ensure that Window globals aren't used after they've been GCed.
This commit is contained in:
parent
c816975750
commit
4972b623e1
3 changed files with 20 additions and 11 deletions
|
@ -461,6 +461,9 @@ impl<'a, T: Reflectable> ScriptHelpers for JSRef<'a, T> {
|
|||
|
||||
impl<'a> WindowHelpers for JSRef<'a, Window> {
|
||||
fn clear_js_context(self) {
|
||||
let document = self.Document().root();
|
||||
NodeCast::from_ref(document.r()).teardown();
|
||||
|
||||
*self.js_context.borrow_mut() = None;
|
||||
*self.browser_context.borrow_mut() = None;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue