Mercurial > emacs
comparison src/xterm.c @ 83522:a5d712e6585a
Fix crashes in `delete-terminal' caused by recursive calls or X displays with live frames.
* src/termhooks.h (terminal) <deleted>: New member.
* src/term.c (delete_tty): Use it.
(deleting_tty): Remove old variable.
* src/terminal.c (delete_terminal): Use terminal->deleted.
* src/xterm.c (x_delete_terminal): Use terminal->deleted. Delete all
frames on the display explicitly.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-562
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Sat, 20 May 2006 12:20:41 +0000 |
parents | ab6ab63755f7 |
children | b2e7507b55c6 |
comparison
equal
deleted
inserted
replaced
83521:40a5d8a15056 | 83522:a5d712e6585a |
---|---|
10835 void | 10835 void |
10836 x_delete_terminal (struct terminal *terminal) | 10836 x_delete_terminal (struct terminal *terminal) |
10837 { | 10837 { |
10838 struct x_display_info *dpyinfo = terminal->display_info.x; | 10838 struct x_display_info *dpyinfo = terminal->display_info.x; |
10839 int i; | 10839 int i; |
10840 Lisp_Object tail, frame; | |
10841 | |
10842 /* Protect against recursive calls. Fdelete_frame calls us back | |
10843 when we delete our last frame. */ | |
10844 if (terminal->deleted) | |
10845 return; | |
10846 terminal->deleted = 1; | |
10847 | |
10848 /* Check for and close live frames that are still on this | |
10849 terminal. */ | |
10850 FOR_EACH_FRAME (tail, frame) | |
10851 { | |
10852 struct frame *f = XFRAME (frame); | |
10853 if (FRAME_LIVE_P (f) && f->terminal == terminal) | |
10854 { | |
10855 Fdelete_frame (frame, Qt); | |
10856 } | |
10857 } | |
10840 | 10858 |
10841 BLOCK_INPUT; | 10859 BLOCK_INPUT; |
10842 /* Free the fonts in the font table. */ | 10860 /* Free the fonts in the font table. */ |
10843 for (i = 0; i < dpyinfo->n_fonts; i++) | 10861 for (i = 0; i < dpyinfo->n_fonts; i++) |
10844 if (dpyinfo->font_table[i].name) | 10862 if (dpyinfo->font_table[i].name) |