Bug 1296258 - prevent memory leak in ScaledFontBase::GetGlyphDesignMetrics. r?jrmuizel draft
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Thu, 18 Aug 2016 14:46:12 +0300
changeset 402540 cd76e96737fe8cd40fa5e9901b70b4f31894a7c5
parent 400825 054d4856cea6150a6638e5daf7913713281af97d
child 528705 2eeb950edf2daa1a412ba7d11c0d164e155727c0
push id26694
push userbmo:bpostelnicu@mozilla.com
push dateThu, 18 Aug 2016 11:48:40 +0000
reviewersjrmuizel
bugs1296258
milestone51.0a1
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.");
 }