Bug 1296258 - prevent memory leak in ScaledFontBase::GetGlyphDesignMetrics. r=jrmuizel
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Thu, 18 Aug 2016 14:46:12 +0300
changeset 310644 3748b7a5ea35f7e4ea5254234138bbaf46a280a2
parent 310643 35416a1541ae9860846ec93081d12b7e96c930c3
child 310645 e0bffa9456d64902a3d9a5c7a7b82c24ec721d8f
push id31615
push userbpostelnicu@mozilla.com
push dateTue, 23 Aug 2016 08:00:22 +0000
treeherderautoland@3748b7a5ea35 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1296258
milestone51.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 1296258 - prevent memory leak in ScaledFontBase::GetGlyphDesignMetrics. r=jrmuizel MozReview-Commit-ID: J3iaMWeVAQ7
gfx/2d/ScaledFontBase.cpp
--- a/gfx/2d/ScaledFontBase.cpp
+++ b/gfx/2d/ScaledFontBase.cpp
@@ -230,16 +230,17 @@ ScaledFontBase::GetGlyphDesignMetrics(co
         else if (cairo_scaled_font_get_type(mScaledFont) == CAIRO_FONT_TYPE_DWRITE) {
           if (aGlyphMetrics[i].mWidth > 0 && aGlyphMetrics[i].mHeight > 0) {
             aGlyphMetrics[i].mWidth -= 2.0f;
             aGlyphMetrics[i].mXBearing += 1.0f;
           }
         }
 #endif
       }
+      cairo_font_options_destroy(options);
     }
 
   }
 #endif
 
   // Don't know how to get the glyph metrics...
   MOZ_CRASH("The specific backend type is not supported for GetGlyphDesignMetrics.");
 }