# HG changeset patch # User Karoly Lorentey # Date 1121028277 0 # Node ID 026d9ba414d9359a66b7a824f8c6bd877fd3806b # Parent 5f293f92f85e70c0dbf0ae473322a9de8ff930fd 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 diff -r 5f293f92f85e -r 026d9ba414d9 src/xdisp.c --- 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; }