Bug 1167403 - Mark gfxFont::GlyphChangeObserver::mFont as MOZ_NON_OWNING_REF. r=jtd
authorMichael Layzell <michael@thelayzells.com>
Fri, 22 May 2015 08:23:00 -0400
changeset 279990 0cc0541804753740ac22c87d034a255c77d74ece
parent 279989 9052882b93309fdf08cc8329047e2cd2d2775683
child 279991 2672dbf9be5d562fdd045d6fe16edd21982edc60
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjtd
bugs1167403
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1167403 - Mark gfxFont::GlyphChangeObserver::mFont as MOZ_NON_OWNING_REF. r=jtd
gfx/thebes/gfxFont.h
--- a/gfx/thebes/gfxFont.h
+++ b/gfx/thebes/gfxFont.h
@@ -1767,17 +1767,19 @@ public:
         // This gets called when the gfxFont dies.
         void ForgetFont() { mFont = nullptr; }
         virtual void NotifyGlyphsChanged() = 0;
     protected:
         explicit GlyphChangeObserver(gfxFont *aFont) : mFont(aFont)
         {
             mFont->AddGlyphChangeObserver(this);
         }
-        gfxFont* mFont;
+        // This pointer is nulled by ForgetFont in the gfxFont's
+        // destructor. Before the gfxFont dies.
+        gfxFont* MOZ_NON_OWNING_REF mFont;
     };
     friend class GlyphChangeObserver;
 
     bool GlyphsMayChange()
     {
         // Currently only fonts with SVG glyphs can have animated glyphs
         return mFontEntry->TryGetSVGData(this);
     }