diff options
Diffstat (limited to 'pango/pangoxft-fontmap.c')
-rw-r--r-- | pango/pangoxft-fontmap.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/pango/pangoxft-fontmap.c b/pango/pangoxft-fontmap.c index 3ca383b5..eef3ce77 100644 --- a/pango/pangoxft-fontmap.c +++ b/pango/pangoxft-fontmap.c @@ -516,16 +516,21 @@ pango_xft_font_map_load_font (PangoFontMap *fontmap, PangoXftFontMap *xfontmap = (PangoXftFontMap *)fontmap; XftPattern *pattern, *match; XftResult res; + PangoFont *font = NULL; pattern = pango_xft_make_pattern (description); match = XftFontMatch (xfontmap->display, xfontmap->screen, pattern, &res); + XftPatternDestroy (pattern); if (match) - return pango_xft_font_map_new_font (fontmap, match); - - return NULL; + { + font = pango_xft_font_map_new_font (fontmap, match); + XftPatternDestroy (match); + } + + return font; } |