From 9fef6a7ba98334f577f63ee0ad31853c389d93cd Mon Sep 17 00:00:00 2001 From: "davemoore@chromium.org" Date: Mon, 19 Oct 2009 21:45:13 +0000 Subject: Plug a font leak. Review URL: http://codereview.chromium.org/293011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29462 0039d316-1c4b-4281-b951-d872f2087c98 --- app/gfx/font_skia.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/gfx/font_skia.cc b/app/gfx/font_skia.cc index 70d6cf2..37cbe8d 100644 --- a/app/gfx/font_skia.cc +++ b/app/gfx/font_skia.cc @@ -171,7 +171,7 @@ int Font::GetStringWidth(const std::wstring& text) const { double Font::avg_width() { if (avg_width_ < 0) { // First get the pango based width - PangoFontDescription* pango_desc = gfx::Font::PangoFontFromGfxFont(*this); + PangoFontDescription* pango_desc = PangoFontFromGfxFont(*this); PangoContext* context = gdk_pango_context_get_for_screen(gdk_screen_get_default()); PangoFontMetrics* pango_metrics = @@ -189,6 +189,8 @@ double Font::avg_width() { double dialog_units = (text_width / 26 + 1) / 2; avg_width_ = std::min(pango_width, dialog_units); + pango_font_metrics_unref(pango_metrics); + pango_font_description_free(pango_desc); } return avg_width_; } -- cgit v1.1