summaryrefslogtreecommitdiff
path: root/src/xftfont.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xftfont.c')
-rw-r--r--src/xftfont.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/xftfont.c b/src/xftfont.c
index 04aff72cfeb..41941509bc2 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -628,6 +628,12 @@ xftfont_shape (Lisp_Object lgstring, Lisp_Object direction)
static int
xftfont_end_for_frame (struct frame *f)
{
+ /* XftDrawDestroy tries to access dpyinfo->display, which could've
+ been destroyed by now, causing Emacs to crash. The alternative
+ is to leak the XftDraw, but that's better than a crash. */
+ if (!FRAME_X_DISPLAY (f))
+ return 0;
+
block_input ();
XftDraw *xft_draw;