diff src/xftfont.c @ 103650:e561e9f73ad4

* xftfont.c (xftfont_open): Avoid passing NULL argument to XftLockFace.
author Chong Yidong <cyd@stupidchicken.com>
date Tue, 30 Jun 2009 22:07:44 +0000
parents 3b14cedd241f
children a7805f91abdd
line wrap: on
line diff
--- a/src/xftfont.c	Tue Jun 30 21:29:44 2009 +0000
+++ b/src/xftfont.c	Tue Jun 30 22:07:44 2009 +0000
@@ -287,14 +287,15 @@
   match = XftFontMatch (display, FRAME_X_SCREEN_NUMBER (f), pat, &result);
   FcPatternDestroy (pat);
   xftfont = XftFontOpenPattern (display, match);
+  if (!xftfont)
+    {
+      UNBLOCK_INPUT;
+      XftPatternDestroy (match);
+      return Qnil;
+    }
   ft_face = XftLockFace (xftfont);
   UNBLOCK_INPUT;
 
-  if (! xftfont)
-    {
-      XftPatternDestroy (match);
-      return Qnil;
-    }
   /* We should not destroy PAT here because it is kept in XFTFONT and
      destroyed automatically when XFTFONT is closed.  */
   font_object = font_make_object (VECSIZE (struct xftfont_info), entity, size);