aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/node.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2015-02-26 00:19:27 -0500
committerJosh Matthews <josh@joshmatthews.net>2015-03-03 16:25:40 -0500
commit4972b623e18d2bdad62a8c617e6885eb9b8158b8 (patch)
treef0ede2b7b1635bd97d57e85983558bb793ac0971 /components/script/dom/node.rs
parentc816975750c44ea9217e10f1f13ed1e94068a9e8 (diff)
downloadservo-4972b623e18d2bdad62a8c617e6885eb9b8158b8.tar.gz
servo-4972b623e18d2bdad62a8c617e6885eb9b8158b8.zip
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.
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r--components/script/dom/node.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index 7526c2490d2..a0486e6ee11 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -490,9 +490,18 @@ pub trait NodeHelpers<'a> {
fn get_unique_id(self) -> String;
fn summarize(self) -> NodeInfo;
+
+ fn teardown(self);
}
impl<'a> NodeHelpers<'a> for JSRef<'a, Node> {
+ fn teardown(self) {
+ self.layout_data.dispose();
+ for kid in self.children() {
+ kid.teardown();
+ }
+ }
+
/// Dumps the subtree rooted at this node, for debugging.
fn dump(self) {
self.dump_indent(0);