Stop GCing before dropping the root rule node.

We already gc before dropping the RuleTree.
This commit is contained in:
Bobby Holley 2017-06-30 00:15:23 -07:00
parent ece35f9caa
commit 31b1233a73

View file

@ -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;
}