diff options
| author | Jan Djärv | 2011-11-05 13:04:34 +0100 |
|---|---|---|
| committer | Jan Djärv | 2011-11-05 13:04:34 +0100 |
| commit | c9e7db78eff4bd8cf9e6abe3d33eb83c7d6cbf00 (patch) | |
| tree | 39d5050ebc8c8f826332e1a1aff48109bbef52c1 | |
| parent | a6fc3b5c539c0a35e4447a12cc395294952d7561 (diff) | |
| download | emacs-c9e7db78eff4bd8cf9e6abe3d33eb83c7d6cbf00.tar.gz emacs-c9e7db78eff4bd8cf9e6abe3d33eb83c7d6cbf00.zip | |
* xfns.c (unwind_create_frame): Fix comment.
(Fx_create_frame, x_create_tip_frame): Move
terminal->reference_count++ just before making the frame
official. Move initialization of image_cache_refcount and
dpyinfo_refcount before calling init_frame_faces.
Fixes: debbugs:9943
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/xfns.c | 35 |
2 files changed, 27 insertions, 16 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 83e6154fb5f..2bad4e388d0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2011-11-05 Jan Djärv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * xfns.c (unwind_create_frame): Fix comment. | ||
| 4 | (Fx_create_frame, x_create_tip_frame): Move | ||
| 5 | terminal->reference_count++ just before making the frame | ||
| 6 | official. Move initialization of image_cache_refcount and | ||
| 7 | dpyinfo_refcount before calling init_frame_faces (Bug#9943). | ||
| 8 | |||
| 1 | 2011-11-05 Eli Zaretskii <eliz@gnu.org> | 9 | 2011-11-05 Eli Zaretskii <eliz@gnu.org> |
| 2 | 10 | ||
| 3 | Support MSVC build with newer versions of Visual Studio. | 11 | Support MSVC build with newer versions of Visual Studio. |
diff --git a/src/xfns.c b/src/xfns.c index ac030582ffe..49c4c774cae 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -2914,7 +2914,7 @@ x_free_gcs (struct frame *f) | |||
| 2914 | 2914 | ||
| 2915 | 2915 | ||
| 2916 | /* Handler for signals raised during x_create_frame and | 2916 | /* Handler for signals raised during x_create_frame and |
| 2917 | x_create_top_frame. FRAME is the frame which is partially | 2917 | x_create_tip_frame. FRAME is the frame which is partially |
| 2918 | constructed. */ | 2918 | constructed. */ |
| 2919 | 2919 | ||
| 2920 | static Lisp_Object | 2920 | static Lisp_Object |
| @@ -3138,7 +3138,6 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 3138 | FRAME_CAN_HAVE_SCROLL_BARS (f) = 1; | 3138 | FRAME_CAN_HAVE_SCROLL_BARS (f) = 1; |
| 3139 | 3139 | ||
| 3140 | f->terminal = dpyinfo->terminal; | 3140 | f->terminal = dpyinfo->terminal; |
| 3141 | f->terminal->reference_count++; | ||
| 3142 | 3141 | ||
| 3143 | f->output_method = output_x_window; | 3142 | f->output_method = output_x_window; |
| 3144 | f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output)); | 3143 | f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output)); |
| @@ -3308,6 +3307,12 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 3308 | "scrollBarBackground", | 3307 | "scrollBarBackground", |
| 3309 | "ScrollBarBackground", 0); | 3308 | "ScrollBarBackground", 0); |
| 3310 | 3309 | ||
| 3310 | #if GLYPH_DEBUG | ||
| 3311 | image_cache_refcount = | ||
| 3312 | FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; | ||
| 3313 | dpyinfo_refcount = dpyinfo->reference_count; | ||
| 3314 | #endif /* GLYPH_DEBUG */ | ||
| 3315 | |||
| 3311 | /* Init faces before x_default_parameter is called for scroll-bar | 3316 | /* Init faces before x_default_parameter is called for scroll-bar |
| 3312 | parameters because that function calls x_set_scroll_bar_width, | 3317 | parameters because that function calls x_set_scroll_bar_width, |
| 3313 | which calls change_frame_size, which calls Fset_window_buffer, | 3318 | which calls change_frame_size, which calls Fset_window_buffer, |
| @@ -3316,11 +3321,6 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 3316 | happen. */ | 3321 | happen. */ |
| 3317 | init_frame_faces (f); | 3322 | init_frame_faces (f); |
| 3318 | 3323 | ||
| 3319 | #if GLYPH_DEBUG | ||
| 3320 | image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount; | ||
| 3321 | dpyinfo_refcount = dpyinfo->reference_count; | ||
| 3322 | #endif /* GLYPH_DEBUG */ | ||
| 3323 | |||
| 3324 | /* The X resources controlling the menu-bar and tool-bar are | 3324 | /* The X resources controlling the menu-bar and tool-bar are |
| 3325 | processed specially at startup, and reflected in the mode | 3325 | processed specially at startup, and reflected in the mode |
| 3326 | variables; ignore them here. */ | 3326 | variables; ignore them here. */ |
| @@ -3364,6 +3364,7 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 3364 | x_make_gc (f); | 3364 | x_make_gc (f); |
| 3365 | 3365 | ||
| 3366 | /* Now consider the frame official. */ | 3366 | /* Now consider the frame official. */ |
| 3367 | f->terminal->reference_count++; | ||
| 3367 | FRAME_X_DISPLAY_INFO (f)->reference_count++; | 3368 | FRAME_X_DISPLAY_INFO (f)->reference_count++; |
| 3368 | Vframe_list = Fcons (frame, Vframe_list); | 3369 | Vframe_list = Fcons (frame, Vframe_list); |
| 3369 | 3370 | ||
| @@ -4594,7 +4595,6 @@ x_create_tip_frame (struct x_display_info *dpyinfo, | |||
| 4594 | record_unwind_protect (unwind_create_tip_frame, frame); | 4595 | record_unwind_protect (unwind_create_tip_frame, frame); |
| 4595 | 4596 | ||
| 4596 | f->terminal = dpyinfo->terminal; | 4597 | f->terminal = dpyinfo->terminal; |
| 4597 | f->terminal->reference_count++; | ||
| 4598 | 4598 | ||
| 4599 | /* By setting the output method, we're essentially saying that | 4599 | /* By setting the output method, we're essentially saying that |
| 4600 | the frame is live, as per FRAME_LIVE_P. If we get a signal | 4600 | the frame is live, as per FRAME_LIVE_P. If we get a signal |
| @@ -4716,6 +4716,12 @@ x_create_tip_frame (struct x_display_info *dpyinfo, | |||
| 4716 | x_default_parameter (f, parms, Qborder_color, build_string ("black"), | 4716 | x_default_parameter (f, parms, Qborder_color, build_string ("black"), |
| 4717 | "borderColor", "BorderColor", RES_TYPE_STRING); | 4717 | "borderColor", "BorderColor", RES_TYPE_STRING); |
| 4718 | 4718 | ||
| 4719 | #if GLYPH_DEBUG | ||
| 4720 | image_cache_refcount = | ||
| 4721 | FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; | ||
| 4722 | dpyinfo_refcount = dpyinfo->reference_count; | ||
| 4723 | #endif /* GLYPH_DEBUG */ | ||
| 4724 | |||
| 4719 | /* Init faces before x_default_parameter is called for scroll-bar | 4725 | /* Init faces before x_default_parameter is called for scroll-bar |
| 4720 | parameters because that function calls x_set_scroll_bar_width, | 4726 | parameters because that function calls x_set_scroll_bar_width, |
| 4721 | which calls change_frame_size, which calls Fset_window_buffer, | 4727 | which calls change_frame_size, which calls Fset_window_buffer, |
| @@ -4724,11 +4730,6 @@ x_create_tip_frame (struct x_display_info *dpyinfo, | |||
| 4724 | happen. */ | 4730 | happen. */ |
| 4725 | init_frame_faces (f); | 4731 | init_frame_faces (f); |
| 4726 | 4732 | ||
| 4727 | #if GLYPH_DEBUG | ||
| 4728 | image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount; | ||
| 4729 | dpyinfo_refcount = dpyinfo->reference_count; | ||
| 4730 | #endif /* GLYPH_DEBUG */ | ||
| 4731 | |||
| 4732 | f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; | 4733 | f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; |
| 4733 | 4734 | ||
| 4734 | x_figure_window_size (f, parms, 0); | 4735 | x_figure_window_size (f, parms, 0); |
| @@ -4834,14 +4835,16 @@ x_create_tip_frame (struct x_display_info *dpyinfo, | |||
| 4834 | 4835 | ||
| 4835 | UNGCPRO; | 4836 | UNGCPRO; |
| 4836 | 4837 | ||
| 4838 | /* Now that the frame will be official, it counts as a reference to | ||
| 4839 | its display and terminal. */ | ||
| 4840 | FRAME_X_DISPLAY_INFO (f)->reference_count++; | ||
| 4841 | f->terminal->reference_count++; | ||
| 4842 | |||
| 4837 | /* It is now ok to make the frame official even if we get an error | 4843 | /* It is now ok to make the frame official even if we get an error |
| 4838 | below. And the frame needs to be on Vframe_list or making it | 4844 | below. And the frame needs to be on Vframe_list or making it |
| 4839 | visible won't work. */ | 4845 | visible won't work. */ |
| 4840 | Vframe_list = Fcons (frame, Vframe_list); | 4846 | Vframe_list = Fcons (frame, Vframe_list); |
| 4841 | 4847 | ||
| 4842 | /* Now that the frame is official, it counts as a reference to | ||
| 4843 | its display. */ | ||
| 4844 | FRAME_X_DISPLAY_INFO (f)->reference_count++; | ||
| 4845 | 4848 | ||
| 4846 | /* Setting attributes of faces of the tooltip frame from resources | 4849 | /* Setting attributes of faces of the tooltip frame from resources |
| 4847 | and similar will increment face_change_count, which leads to the | 4850 | and similar will increment face_change_count, which leads to the |