]> git.eshelyaron.com Git - emacs.git/commitdiff
Attempt to fix rare assertion violations in 'mark_terminals'
authorEli Zaretskii <eliz@gnu.org>
Thu, 6 Jun 2024 07:47:21 +0000 (10:47 +0300)
committerEshel Yaron <me@eshelyaron.com>
Thu, 6 Jun 2024 10:25:21 +0000 (12:25 +0200)
* 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

index e8316ba32e82f3a4f348bc68aca4ac6044fe6b8e..5c21341d9053b3002cd1cab4d2b2f10d784f1d0f 100644 (file)
@@ -22,6 +22,7 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #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