Bug 1364627 - fix leaking of Cairo scaled font when creating ScaledFontFontconfig from a recording. r=jrmuizel
authorLee Salzman <lsalzman@mozilla.com>
Wed, 31 May 2017 14:46:04 -0400
changeset 409763 5e7872cb3b5c2ae734d119ae75f3b1caa27ef63d
parent 409762 933ff638ea341d44700c4a89eda866c53c8ee2dd
child 409764 172218dd971dc5ede35cdb26a706124576c85efd
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1364627
milestone55.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 1364627 - fix leaking of Cairo scaled font when creating ScaledFontFontconfig from a recording. r=jrmuizel MozReview-Commit-ID: FspSjKzhrR2
gfx/2d/ScaledFontFontconfig.cpp
--- a/gfx/2d/ScaledFontFontconfig.cpp
+++ b/gfx/2d/ScaledFontFontconfig.cpp
@@ -316,16 +316,17 @@ ScaledFontFontconfig::CreateFromInstance
     gfxWarning() << "Failed creating Cairo scaled font for font face";
     FcPatternDestroy(pattern);
     return nullptr;
   }
 
   RefPtr<ScaledFontFontconfig> scaledFont =
     new ScaledFontFontconfig(cairoScaledFont, pattern, aUnscaledFont, aSize);
 
+  cairo_scaled_font_destroy(cairoScaledFont);
   FcPatternDestroy(pattern);
 
   return scaledFont.forget();
 }
 
 already_AddRefed<UnscaledFont>
 UnscaledFontFontconfig::CreateFromFontDescriptor(const uint8_t* aData, uint32_t aDataLength)
 {