changeset 56782:1dac05def6d8

* xterm.c (x_catch_errors_unwind): Do not XSync if display has closed.
author Jan Djärv <jan.h.d@swipnet.se>
date Tue, 24 Aug 2004 17:22:33 +0000
parents c54fa35b4ded
children 33930c56419f d58083e7ec81
files src/ChangeLog src/xterm.c
diffstat 2 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue Aug 24 10:54:39 2004 +0000
+++ b/src/ChangeLog	Tue Aug 24 17:22:33 2004 +0000
@@ -1,5 +1,7 @@
 2004-08-24  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
+	* 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.
--- a/src/xterm.c	Tue Aug 24 10:54:39 2004 +0000
+++ b/src/xterm.c	Tue Aug 24 17:22:33 2004 +0000
@@ -7604,11 +7604,13 @@
 x_catch_errors_unwind (old_val)
      Lisp_Object old_val;
 {
-  Lisp_Object first;
-
-  first = XCAR (old_val);
-
-  XSync (XSAVE_VALUE (first)->pointer, False);
+  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;