From 181208a4e4be641fc18f54b06128265a27a80c46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 15 Nov 2016 17:08:15 +0100 Subject: [PATCH] rule tree: Avoid yet another dumb assertion when dropping the rule tree. --- components/style/rule_tree/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/style/rule_tree/mod.rs b/components/style/rule_tree/mod.rs index f1574ea5856e..90afc23c3371 100644 --- a/components/style/rule_tree/mod.rs +++ b/components/style/rule_tree/mod.rs @@ -410,10 +410,12 @@ impl StrongRuleNode { debug_assert!(thread_state::get().is_layout() && !thread_state::get().is_worker()); + // NB: This can run from the root node destructor, so we can't use + // `get()`, since it asserts the refcount is bigger than zero. let me = &*self.ptr; debug_assert!(me.is_root()); - let current = self.get().next_free.load(Ordering::SeqCst); + let current = me.next_free.load(Ordering::SeqCst); if current == FREE_LIST_SENTINEL { return None; }