From 31b1233a734819d355d4582e306c818208190a59 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Fri, 30 Jun 2017 00:15:23 -0700 Subject: [PATCH] Stop GCing before dropping the root rule node. We already gc before dropping the RuleTree. --- components/style/rule_tree/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/components/style/rule_tree/mod.rs b/components/style/rule_tree/mod.rs index f4fe5da37be..d6f5abfe3d4 100644 --- a/components/style/rule_tree/mod.rs +++ b/components/style/rule_tree/mod.rs @@ -1329,10 +1329,8 @@ impl Drop for StrongRuleNode { ptr::null_mut()); if node.parent.is_none() { debug!("Dropping root node!"); - // NOTE: Calling this is fine, because the rule tree root - // destructor needs to happen from the layout thread, where the - // stylist, and hence, the rule tree, is held. - unsafe { self.gc() }; + // The free list should be null by this point + debug_assert!(node.next_free.load(Ordering::Relaxed).is_null()); let _ = unsafe { Box::from_raw(self.ptr()) }; return; }