From b477c971bce2f9eab4f3f410e453a78688339b7e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 6 Jun 2024 10:47:21 +0300 Subject: [PATCH] Attempt to fix rare assertion violations in 'mark_terminals' * src/terminal.c (delete_terminal): Block input while we modify the frame list and 'terminal_list'. (Bug#71289) (cherry picked from commit 7fbafb9d9527f3888469dead8309fd748d2fb9e0) --- src/terminal.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/terminal.c b/src/terminal.c index e8316ba32e8..5c21341d905 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -22,6 +22,7 @@ along with GNU Emacs. If not, see . */ #include "character.h" #include "frame.h" #include "termchar.h" +#include "blockinput.h" #include "termhooks.h" #include "keyboard.h" @@ -316,6 +317,9 @@ delete_terminal (struct terminal *terminal) delete_terminal_hook when we delete our last frame. */ if (!terminal->name) return; + + /* Protection while we are in inconsistent state. */ + block_input (); xfree (terminal->name); terminal->name = NULL; @@ -331,6 +335,7 @@ delete_terminal (struct terminal *terminal) } delete_terminal_internal (terminal); + unblock_input (); } void -- 2.39.5