diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-19 21:45:13 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-19 21:45:13 +0000 |
commit | 9fef6a7ba98334f577f63ee0ad31853c389d93cd (patch) | |
tree | 2808b8e4e8965886fd319a3915965b11a7592f51 /app | |
parent | 523b6f9530faa6429f2ed4ad96442d1b53ee6190 (diff) | |
download | chromium_src-9fef6a7ba98334f577f63ee0ad31853c389d93cd.zip chromium_src-9fef6a7ba98334f577f63ee0ad31853c389d93cd.tar.gz chromium_src-9fef6a7ba98334f577f63ee0ad31853c389d93cd.tar.bz2 |
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
Diffstat (limited to 'app')
-rw-r--r-- | app/gfx/font_skia.cc | 4 |
1 files changed, 3 insertions, 1 deletions
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_; } |