fix PangoFontMetrics leak in GetCharHeight() (bug 1691180)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45128 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2007-03-30 11:48:58 +00:00
parent b8c73e75d0
commit 2e61f68141

View File

@ -1830,7 +1830,12 @@ wxCoord wxWindowDC::GetCharWidth() const
wxCoord wxWindowDC::GetCharHeight() const
{
PangoFontMetrics *metrics = pango_context_get_metrics (m_context, m_fontdesc, pango_context_get_language(m_context));
return PANGO_PIXELS (pango_font_metrics_get_descent (metrics) + pango_font_metrics_get_ascent (metrics));
wxCHECK_MSG( metrics, -1, _T("failed to get pango font metrics") );
wxCoord h = PANGO_PIXELS (pango_font_metrics_get_descent (metrics) +
pango_font_metrics_get_ascent (metrics));
pango_font_metrics_unref (metrics);
return h;
}
void wxWindowDC::Clear()