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 341644 3748b7a5ea35f7e4ea5254234138bbaf46a280a2
parent 341610 35416a1541ae9860846ec93081d12b7e96c930c3
child 341645 e0bffa9456d64902a3d9a5c7a7b82c24ec721d8f
push id5
push userfmarier@mozilla.com
push dateFri, 26 Aug 2016 00:45:46 +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.");
 }