From: Jan Djärv Date: Tue, 24 Aug 2004 17:22:33 +0000 (+0000) Subject: * xterm.c (x_catch_errors_unwind): Do not XSync if display has closed. X-Git-Tag: ttn-vms-21-2-B4~5188 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2728b5d02c0686c40c49aebd00f7d5520b371aed;p=emacs.git * xterm.c (x_catch_errors_unwind): Do not XSync if display has closed. --- diff --git a/src/ChangeLog b/src/ChangeLog index 35731460a70..d49514b2fc0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2004-08-24 Jan Dj,Ad(Brv + * xterm.c (x_catch_errors_unwind): Do not XSync if display has closed. + * xfns.c (x_window_to_frame, x_any_window_to_frame) (x_non_menubar_window_to_frame, x_menubar_window_to_frame) (x_top_window_to_frame): Return 0 if wdesc is None. diff --git a/src/xterm.c b/src/xterm.c index 5e6a236c4be..c1bfd11985e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7604,11 +7604,13 @@ static Lisp_Object x_catch_errors_unwind (old_val) Lisp_Object old_val; { - Lisp_Object first; + Lisp_Object first = XCAR (old_val); + Display *dpy = XSAVE_VALUE (first)->pointer; - first = XCAR (old_val); - - XSync (XSAVE_VALUE (first)->pointer, False); + /* The display may have been closed before this function is called. + Check if it is still open before calling XSync. */ + if (x_display_info_for_display (dpy) != 0) + XSync (dpy, False); x_error_message_string = XCDR (old_val); return Qnil;