Bug 1223002 - Always call ReleaseGrFace to balance GetGrFace, even if the face is null. r=jdaggett
authorJonathan Kew <jkew@mozilla.com>
Fri, 20 Nov 2015 06:09:59 +0000
changeset 273503 ef2ee7ebb2503f1af7699db407dc09777184243a
parent 273502 597c3c78da4aaeea391119a1d0887eff3baba6fe
child 273504 815c0c1d5619a4a122108148f303db3ed05c2247
push id29705
push userkwierso@gmail.com
push dateFri, 20 Nov 2015 22:36:48 +0000
treeherdermozilla-central@e3d9cf3dc326 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdaggett
bugs1223002
milestone45.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 1223002 - Always call ReleaseGrFace to balance GetGrFace, even if the face is null. r=jdaggett
gfx/thebes/gfxFontEntry.cpp
--- a/gfx/thebes/gfxFontEntry.cpp
+++ b/gfx/thebes/gfxFontEntry.cpp
@@ -866,18 +866,18 @@ bool
 gfxFontEntry::HasGraphiteSpaceContextuals()
 {
     if (!mGraphiteSpaceContextualsInitialized) {
         gr_face* face = GetGrFace();
         if (face) {
             const gr_faceinfo* faceInfo = gr_face_info(face, 0);
             mHasGraphiteSpaceContextuals =
                 faceInfo->space_contextuals != gr_faceinfo::gr_space_none;
-            ReleaseGrFace(face);
         }
+        ReleaseGrFace(face); // always balance GetGrFace, even if face is null
         mGraphiteSpaceContextualsInitialized = true;
     }
     return mHasGraphiteSpaceContextuals;
 }
 
 #define FEATURE_SCRIPT_MASK 0x000000ff // script index replaces low byte of tag
 
 // check for too many script codes
@@ -1046,17 +1046,17 @@ gfxFontEntry::SupportsGraphiteFeature(ui
     // graphite feature check uses the last script slot
     uint32_t scriptFeature = SCRIPT_FEATURE(FEATURE_SCRIPT_MASK, aFeatureTag);
     bool result;
     if (mSupportedFeatures->Get(scriptFeature, &result)) {
         return result;
     }
 
     gr_face* face = GetGrFace();
-    result = gr_face_find_fref(face, aFeatureTag) != nullptr;
+    result = face ? gr_face_find_fref(face, aFeatureTag) != nullptr : false;
     ReleaseGrFace(face);
 
     mSupportedFeatures->Put(scriptFeature, result);
 
     return result;
 }
 
 bool