summaryrefslogtreecommitdiff
path: root/src/xterm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 593716032e1..c1bfd11985e 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -6174,7 +6174,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
f = x_top_window_to_frame (dpyinfo, event.xmap.window);
if (f)
{
- /* wait_reading_process_input will notice this and update
+ /* wait_reading_process_output will notice this and update
the frame's display structures.
If we where iconified, we should not set garbaged,
because that stops redrawing on Expose events. This looks
@@ -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;