changeset 83339:026d9ba414d9

At long last, fix annoying SELECTED_FRAME crashes after unexpected connection failures. Yay! * src/xdisp.c (select_frame_for_redisplay): Add xassert for FRAME_LIVE_P. (unwind_redisplay): Don't restore previous frame if it has been deleted. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-379
author Karoly Lorentey <lorentey@elte.hu>
date Sun, 10 Jul 2005 20:44:37 +0000
parents 5f293f92f85e
children f92ac4808cd4
files src/xdisp.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Sun Jul 10 20:35:39 2005 +0000
+++ b/src/xdisp.c	Sun Jul 10 20:44:37 2005 +0000
@@ -10037,6 +10037,8 @@
   Lisp_Object tail, sym, val;
   Lisp_Object old = selected_frame;
 
+  xassert (FRAME_LIVE_P (frame));
+
   selected_frame = frame;
 
   for (tail = XFRAME (frame)->param_alist; CONSP (tail); tail = XCDR (tail))
@@ -10815,7 +10817,8 @@
    redisplay_internal.  Reset redisplaying_p to the value it had
    before redisplay_internal was called, and clear
    prevent_freeing_realized_faces_p.  It also selects the previously
-   selected frame.  */
+   selected frame, unless it has been deleted (by an X connection
+   failure during redisplay, for example).  */
 
 static Lisp_Object
 unwind_redisplay (val)
@@ -10826,7 +10829,8 @@
   old_redisplaying_p = XCAR (val);
   redisplaying_p = XFASTINT (old_redisplaying_p);
   old_frame = XCDR (val);
-  if (! EQ (old_frame, selected_frame))
+  if (! EQ (old_frame, selected_frame)
+      && FRAME_LIVE_P (XFRAME (old_frame)))
     select_frame_for_redisplay (old_frame);
   return Qnil;
 }