From bd1bd9cfa77d9bc0a1a481c1393a9b956e1214c8 Mon Sep 17 00:00:00 2001 From: handa Date: Thu, 13 May 2004 02:23:27 +0000 Subject: [PATCH] (mwin__xft_open): Destroy unnecessary patterns. --- src/m17n-X.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/m17n-X.c b/src/m17n-X.c index ca2580c..ff82b47 100644 --- a/src/m17n-X.c +++ b/src/m17n-X.c @@ -2177,7 +2177,7 @@ void * mwin__xft_open (MFrame *frame, char *fontname, int size) { MXftFontInfo *font_info; - XftPattern *pattern; + XftPattern *pattern, *match; XftResult result; MSTRUCT_CALLOC (font_info, MERROR_WIN); @@ -2186,24 +2186,25 @@ mwin__xft_open (MFrame *frame, char *fontname, int size) pattern = XftNameParse (fontname); XftPatternAddDouble (pattern, XFT_PIXEL_SIZE, (double) size); XftPatternAddBool (pattern, XFT_ANTIALIAS, 1); - pattern = XftFontMatch (FRAME_DISPLAY (frame), FRAME_SCREEN (frame), - pattern, &result); - font_info->font_aa = XftFontOpenPattern (FRAME_DISPLAY (frame), pattern); + match = XftFontMatch (FRAME_DISPLAY (frame), FRAME_SCREEN (frame), + pattern, &result); + font_info->font_aa = XftFontOpenPattern (FRAME_DISPLAY (frame), match); if (! font_info->font_aa) goto err; - pattern = XftNameParse (fontname); - XftPatternAddDouble (pattern, XFT_PIXEL_SIZE, (double) size); + XftPatternDel (pattern, XFT_ANTIALIAS); XftPatternAddBool (pattern, XFT_ANTIALIAS, 0); - pattern = XftFontMatch (FRAME_DISPLAY (frame), FRAME_SCREEN (frame), + match = XftFontMatch (FRAME_DISPLAY (frame), FRAME_SCREEN (frame), pattern, &result); - font_info->font_no_aa = XftFontOpenPattern (FRAME_DISPLAY (frame), pattern); + font_info->font_no_aa = XftFontOpenPattern (FRAME_DISPLAY (frame), match); if (! font_info->font_no_aa) goto err; + XftPatternDestroy (pattern); return font_info; err: if (font_info->font_aa) XftFontClose (FRAME_DISPLAY (frame), font_info->font_aa); + XftPatternDestroy (pattern); free (font_info); return NULL; } -- 1.7.10.4