Mercurial > emacs
comparison src/xterm.c @ 34673:77cda2c018e5
(x_connection_closed): Prevent being called recursively
because of an error condition in XtCloseDisplay.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 18 Dec 2000 12:54:00 +0000 |
parents | 0a811c1d7a1d |
children | 1d671133e618 |
comparison
equal
deleted
inserted
replaced
34672:8f55d03259de | 34673:77cda2c018e5 |
---|---|
11254 /* Handling X errors. */ | 11254 /* Handling X errors. */ |
11255 | 11255 |
11256 /* Handle the loss of connection to display DISPLAY. */ | 11256 /* Handle the loss of connection to display DISPLAY. */ |
11257 | 11257 |
11258 static SIGTYPE | 11258 static SIGTYPE |
11259 x_connection_closed (display, error_message) | 11259 x_connection_closed (dpy, error_message) |
11260 Display *display; | 11260 Display *dpy; |
11261 char *error_message; | 11261 char *error_message; |
11262 { | 11262 { |
11263 struct x_display_info *dpyinfo = x_display_info_for_display (display); | 11263 struct x_display_info *dpyinfo = x_display_info_for_display (dpy); |
11264 Lisp_Object frame, tail; | 11264 Lisp_Object frame, tail; |
11265 | 11265 |
11266 /* We have to close the display to inform Xt that it doesn't | 11266 /* We have to close the display to inform Xt that it doesn't |
11267 exist anymore. If we don't, Xt will continue to wait for | 11267 exist anymore. If we don't, Xt will continue to wait for |
11268 events from the display. As a consequence, a sequence of | 11268 events from the display. As a consequence, a sequence of |
11277 Closing the display is reported to lead to a bus error on | 11277 Closing the display is reported to lead to a bus error on |
11278 OpenWindows in certain situations. I suspect that is a bug | 11278 OpenWindows in certain situations. I suspect that is a bug |
11279 in OpenWindows. I don't know how to cicumvent it here. */ | 11279 in OpenWindows. I don't know how to cicumvent it here. */ |
11280 | 11280 |
11281 #ifdef USE_X_TOOLKIT | 11281 #ifdef USE_X_TOOLKIT |
11282 XtCloseDisplay (display); | 11282 { |
11283 /* Prevent being called recursively because of an error condition | |
11284 in XtCloseDisplay. Otherwise, we might end up with printing | |
11285 ``can't find per display information'' in the recursive call | |
11286 instead of printing the original message here. */ | |
11287 int count = x_catch_errors (dpy); | |
11288 XtCloseDisplay (dpy); | |
11289 x_uncatch_errors (dpy, count); | |
11290 } | |
11283 #endif | 11291 #endif |
11284 | 11292 |
11285 /* Indicate that this display is dead. */ | 11293 /* Indicate that this display is dead. */ |
11286 if (dpyinfo) | 11294 if (dpyinfo) |
11287 dpyinfo->display = 0; | 11295 dpyinfo->display = 0; |