comparison src/xftfont.c @ 100427:e0aa0e328261

(xftfont_open): Free Xft font pattern if XftFontOpenPattern fails.
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 15 Dec 2008 01:57:40 +0000
parents 5c8b389c391a
children 42e9e426d886
comparison
equal deleted inserted replaced
100426:0e8afcdd9ee4 100427:e0aa0e328261
277 xftfont = XftFontOpenPattern (display, match); 277 xftfont = XftFontOpenPattern (display, match);
278 ft_face = XftLockFace (xftfont); 278 ft_face = XftLockFace (xftfont);
279 UNBLOCK_INPUT; 279 UNBLOCK_INPUT;
280 280
281 if (! xftfont) 281 if (! xftfont)
282 return Qnil; 282 {
283 XftPatternDestroy (match);
284 return Qnil;
285 }
283 /* We should not destroy PAT here because it is kept in XFTFONT and 286 /* We should not destroy PAT here because it is kept in XFTFONT and
284 destroyed automatically when XFTFONT is closed. */ 287 destroyed automatically when XFTFONT is closed. */
285 font_object = font_make_object (VECSIZE (struct xftfont_info), entity, size); 288 font_object = font_make_object (VECSIZE (struct xftfont_info), entity, size);
286 ASET (font_object, FONT_TYPE_INDEX, Qxft); 289 ASET (font_object, FONT_TYPE_INDEX, Qxft);
287 len = font_unparse_xlfd (entity, size, name, 256); 290 len = font_unparse_xlfd (entity, size, name, 256);