From 8b98f87b924fcb2e79740063b36db1ed0b752853 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 18 May 2022 09:07:41 +0800 Subject: [PATCH] Fix a crash when an X connection is dropped in some situations * src/xterm.c (x_flip_and_flush): Don't try to flush if `inhibit-redisplay' is t. --- src/xterm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/xterm.c b/src/xterm.c index f81d99ca129..c24de0f185f 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -5618,6 +5618,12 @@ show_back_buffer (struct frame *f) static void x_flip_and_flush (struct frame *f) { + /* Flipping buffers requires a working connection to the X server, + which isn't always present if `inhibit-redisplay' is t, since + this can be called from the IO error handler. */ + if (!NILP (Vinhibit_redisplay)) + return; + block_input (); #ifdef HAVE_XDBE if (FRAME_X_NEED_BUFFER_FLIP (f)) -- 2.39.2