use dynwind_begin and dynwind_end
[bpt/emacs.git] / src / xterm.c
index eb33259..b64ca2d 100644 (file)
@@ -7584,7 +7584,7 @@ x_connection_closed (Display *dpy, const char *error_message)
 {
   struct x_display_info *dpyinfo = x_display_info_for_display (dpy);
   Lisp_Object frame, tail;
-  ptrdiff_t idx = SPECPDL_INDEX ();
+  dynwind_begin ();
 
   error_msg = alloca (strlen (error_message) + 1);
   strcpy (error_msg, error_message);
@@ -7673,7 +7673,7 @@ For details, see etc/PROBLEMS.\n",
 
   totally_unblock_input ();
 
-  unbind_to (idx, Qnil);
+  dynwind_end ();
   clear_waiting_for_input ();
 
   /* Tell GCC not to suggest attribute 'noreturn' for this function.  */