diff options
author | Glenn Watson <gw@intuitionlibrary.com> | 2015-05-19 16:14:25 +1000 |
---|---|---|
committer | Glenn Watson <gw@intuitionlibrary.com> | 2015-05-19 16:14:25 +1000 |
commit | 35a570ab66227fb640e64bd50373f1e1a9f51b22 (patch) | |
tree | 13dbe09505867725431267f7bd7ad0b033dec1c8 /components/script/dom/window.rs | |
parent | 90aacf00f866c7ef3b858d84585bd5142f74c9ee (diff) | |
download | servo-35a570ab66227fb640e64bd50373f1e1a9f51b22.tar.gz servo-35a570ab66227fb640e64bd50373f1e1a9f51b22.zip |
Fix several hangs / panics during pipeline cleanup of in progress loads.
This fixes a hang found while testing the jQuery test suite.
Diffstat (limited to 'components/script/dom/window.rs')
-rw-r--r-- | components/script/dom/window.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 2621a9498a3..f791464366d 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -584,6 +584,17 @@ impl<'a> WindowHelpers for JSRef<'a, Window> { let document = self.Document().root(); NodeCast::from_ref(document.r()).teardown(); + // The above code may not catch all DOM objects + // (e.g. DOM objects removed from the tree that haven't + // been collected yet). Forcing a GC here means that + // those DOM objects will be able to call dispose() + // to free their layout data before the layout task + // exits. Without this, those remaining objects try to + // send a message to free their layout data to the + // layout task when the script task is dropped, + // which causes a panic! + self.Gc(); + *self.js_runtime.borrow_mut() = None; *self.browser_context.borrow_mut() = None; } |