diff src/xterm.c @ 83198:d58083e7ec81

Merged in changes from CVS trunk (Jan D. has fixed the XSync call in xterm.c, no need to disable it anymore). Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-506 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-507 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-508 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-238
author Karoly Lorentey <lorentey@elte.hu>
date Tue, 31 Aug 2004 16:30:29 +0000
parents 22658e29bd48 1dac05def6d8
children bc89b722d36f
line wrap: on
line diff
--- a/src/xterm.c	Tue Aug 24 08:45:10 2004 +0000
+++ b/src/xterm.c	Tue Aug 31 16:30:29 2004 +0000
@@ -7608,15 +7608,13 @@
 x_catch_errors_unwind (old_val)
      Lisp_Object old_val;
 {
-  Lisp_Object first;
-
-  first = XCAR (old_val);
-
-#if 0  /* XXX This has dumped core on me several times when my X
-          server crashed.  If this call is important, maybe we should
-          check that the display is still alive. -- lorentey */
-  XSync (XSAVE_VALUE (first)->pointer, False);
-#endif
+  Lisp_Object first = XCAR (old_val);
+  Display *dpy = XSAVE_VALUE (first)->pointer;
+  
+  /* 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;