From e7db2e5d3654c0225e449be94e1315a5e8548a4a Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Thu, 21 Sep 2017 04:18:28 -0500 Subject: [PATCH] =?UTF-8?q?servo:=20Merge=20#18590=20-=20Use=20Atom::from(?= =?UTF-8?q?nsIAtom)=20to=20increment=20reference=20count=20in=20case=20of?= =?UTF-8?q?=20dynam=E2=80=A6=20(from=20hiikezoe:increment-ref-count-for-wi?= =?UTF-8?q?ll-change);=20r=3Dxidorn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …ic atom for will-change. If we don't increment the reference count for the Atom in servo side, it's possible to try to release the Atom in servo side even if we have already released in gecko side. When it happens, nsIAtom::mKind is no longer reliable. https://bugzilla.mozilla.org/show_bug.cgi?id=1401809 --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors Source-Repo: https://github.com/servo/servo Source-Revision: 581f0bf09a8ec35dadd5de207777f79138255e1a --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : b8daadff800d3af1378b2d93707e6a222533bdb7 --- servo/components/style/properties/gecko.mako.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/servo/components/style/properties/gecko.mako.rs b/servo/components/style/properties/gecko.mako.rs index a05a4f7ed7e0..1606a2dc0df8 100644 --- a/servo/components/style/properties/gecko.mako.rs +++ b/servo/components/style/properties/gecko.mako.rs @@ -3482,7 +3482,6 @@ fn static_assert() { pub fn clone_will_change(&self) -> longhands::will_change::computed_value::T { use properties::longhands::will_change::computed_value::T; use gecko_bindings::structs::nsIAtom; - use gecko_string_cache::Atom; use values::CustomIdent; if self.gecko.mWillChange.mBuffer.len() == 0 { @@ -3490,9 +3489,7 @@ fn static_assert() { } else { T::AnimateableFeatures( self.gecko.mWillChange.mBuffer.iter().map(|gecko_atom| { - CustomIdent( - unsafe { Atom::from_addrefed(*gecko_atom as *mut nsIAtom) } - ) + CustomIdent((*gecko_atom as *mut nsIAtom).into()) }).collect() ) }