diff options
| author | Stefan Monnier | 2008-02-21 16:51:07 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-02-21 16:51:07 +0000 |
| commit | 6bd9264021e46b6d147afacd47a1991e0216979a (patch) | |
| tree | 2c12dd6756d5f8b915e6ee27946f15b7c1d21cdb /src | |
| parent | 10a806d3b1398fd6e41a97481d3b0df7d0ca56f4 (diff) | |
| download | emacs-6bd9264021e46b6d147afacd47a1991e0216979a.tar.gz emacs-6bd9264021e46b6d147afacd47a1991e0216979a.zip | |
(x_connection_closed): Consolidate identical tests.
(x_delete_terminal): Don't crash if called via x_connection_closed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/xterm.c | 55 |
2 files changed, 35 insertions, 27 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e1b8d8a5cef..73e4f942a2e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,7 +1,12 @@ | |||
| 1 | 2008-02-21 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * xterm.c (x_connection_closed): Consolidate identical tests. | ||
| 4 | (x_delete_terminal): Don't crash if called via x_connection_closed. | ||
| 5 | |||
| 1 | 2008-02-21 Kenichi Handa <handa@ni.aist.go.jp> | 6 | 2008-02-21 Kenichi Handa <handa@ni.aist.go.jp> |
| 2 | 7 | ||
| 3 | * xdisp.c (decode_mode_spec): New arg string. | 8 | * xdisp.c (decode_mode_spec): New arg string. |
| 4 | (display_mode_element): Adjusted for the above change. | 9 | (display_mode_element): Adjust for the above change. |
| 5 | 10 | ||
| 6 | 2008-02-19 Stefan Monnier <monnier@iro.umontreal.ca> | 11 | 2008-02-19 Stefan Monnier <monnier@iro.umontreal.ca> |
| 7 | 12 | ||
diff --git a/src/xterm.c b/src/xterm.c index d9670fe4446..709be459b20 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -8103,25 +8103,23 @@ x_connection_closed (dpy, error_message) | |||
| 8103 | OpenWindows in certain situations. I suspect that is a bug | 8103 | OpenWindows in certain situations. I suspect that is a bug |
| 8104 | in OpenWindows. I don't know how to circumvent it here. */ | 8104 | in OpenWindows. I don't know how to circumvent it here. */ |
| 8105 | 8105 | ||
| 8106 | #ifdef USE_X_TOOLKIT | ||
| 8107 | /* If DPYINFO is null, this means we didn't open the display | ||
| 8108 | in the first place, so don't try to close it. */ | ||
| 8109 | if (dpyinfo) | 8106 | if (dpyinfo) |
| 8110 | { | 8107 | { |
| 8111 | extern void (*fatal_error_signal_hook) P_ ((void)); | 8108 | #ifdef USE_X_TOOLKIT |
| 8112 | fatal_error_signal_hook = x_fatal_error_signal; | 8109 | /* If DPYINFO is null, this means we didn't open the display |
| 8113 | XtCloseDisplay (dpy); | 8110 | in the first place, so don't try to close it. */ |
| 8114 | fatal_error_signal_hook = NULL; | 8111 | { |
| 8115 | } | 8112 | extern void (*fatal_error_signal_hook) P_ ((void)); |
| 8113 | fatal_error_signal_hook = x_fatal_error_signal; | ||
| 8114 | XtCloseDisplay (dpy); | ||
| 8115 | fatal_error_signal_hook = NULL; | ||
| 8116 | } | ||
| 8116 | #endif | 8117 | #endif |
| 8117 | 8118 | ||
| 8118 | #ifdef USE_GTK | 8119 | #ifdef USE_GTK |
| 8119 | if (dpyinfo) | 8120 | xg_display_close (dpyinfo->display); |
| 8120 | xg_display_close (dpyinfo->display); | ||
| 8121 | #endif | 8121 | #endif |
| 8122 | 8122 | ||
| 8123 | if (dpyinfo) | ||
| 8124 | { | ||
| 8125 | /* Indicate that this display is dead. */ | 8123 | /* Indicate that this display is dead. */ |
| 8126 | dpyinfo->display = 0; | 8124 | dpyinfo->display = 0; |
| 8127 | 8125 | ||
| @@ -11834,30 +11832,35 @@ x_delete_terminal (struct terminal *terminal) | |||
| 11834 | return; | 11832 | return; |
| 11835 | 11833 | ||
| 11836 | BLOCK_INPUT; | 11834 | BLOCK_INPUT; |
| 11835 | /* If called from x_connection_closed, the display may already be closed | ||
| 11836 | and dpyinfo->display was set to 0 to indicate that. */ | ||
| 11837 | if (dpyinfo->display) | ||
| 11838 | { | ||
| 11837 | #ifdef USE_FONT_BACKEND | 11839 | #ifdef USE_FONT_BACKEND |
| 11838 | if (enable_font_backend) | 11840 | if (enable_font_backend) |
| 11839 | XFreeFont (dpyinfo->display, dpyinfo->font); | 11841 | XFreeFont (dpyinfo->display, dpyinfo->font); |
| 11840 | else | 11842 | else |
| 11841 | #endif | 11843 | #endif |
| 11842 | /* Free the fonts in the font table. */ | 11844 | /* Free the fonts in the font table. */ |
| 11843 | for (i = 0; i < dpyinfo->n_fonts; i++) | 11845 | for (i = 0; i < dpyinfo->n_fonts; i++) |
| 11844 | if (dpyinfo->font_table[i].name) | 11846 | if (dpyinfo->font_table[i].name) |
| 11845 | { | 11847 | { |
| 11846 | XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font); | 11848 | XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font); |
| 11847 | } | 11849 | } |
| 11848 | 11850 | ||
| 11849 | x_destroy_all_bitmaps (dpyinfo); | 11851 | x_destroy_all_bitmaps (dpyinfo); |
| 11850 | XSetCloseDownMode (dpyinfo->display, DestroyAll); | 11852 | XSetCloseDownMode (dpyinfo->display, DestroyAll); |
| 11851 | 11853 | ||
| 11852 | #ifdef USE_GTK | 11854 | #ifdef USE_GTK |
| 11853 | xg_display_close (dpyinfo->display); | 11855 | xg_display_close (dpyinfo->display); |
| 11854 | #else | 11856 | #else |
| 11855 | #ifdef USE_X_TOOLKIT | 11857 | #ifdef USE_X_TOOLKIT |
| 11856 | XtCloseDisplay (dpyinfo->display); | 11858 | XtCloseDisplay (dpyinfo->display); |
| 11857 | #else | 11859 | #else |
| 11858 | XCloseDisplay (dpyinfo->display); | 11860 | XCloseDisplay (dpyinfo->display); |
| 11859 | #endif | 11861 | #endif |
| 11860 | #endif /* ! USE_GTK */ | 11862 | #endif /* ! USE_GTK */ |
| 11863 | } | ||
| 11861 | 11864 | ||
| 11862 | x_delete_display (dpyinfo); | 11865 | x_delete_display (dpyinfo); |
| 11863 | UNBLOCK_INPUT; | 11866 | UNBLOCK_INPUT; |