diff options
| author | Eli Zaretskii | 2017-03-25 16:59:17 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2017-03-25 16:59:17 +0300 |
| commit | 8275687bb908174b84021ee15ecd959733cecb9d (patch) | |
| tree | f0bdb2faaf132b6ad764fcd306164f9ca681cd3b /src | |
| parent | 1531c3c9f2844ba992f02ec62cc57f782d073c65 (diff) | |
| download | emacs-8275687bb908174b84021ee15ecd959733cecb9d.tar.gz emacs-8275687bb908174b84021ee15ecd959733cecb9d.zip | |
Fix a segfault due to failure to realize some faces
* src/xdisp.c (redisplay_internal): If the frame becomes garbaged
while redisplaying its windows, redisplay all of its windows
again. (Bug#26097)
(init_iterator): When freeing all realized faces on all frames,
reset the 'face_change' flag of the frame whose window we are
about to iterate.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 82668494927..32550523bc3 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -2716,6 +2716,7 @@ init_iterator (struct it *it, struct window *w, | |||
| 2716 | if (face_change) | 2716 | if (face_change) |
| 2717 | { | 2717 | { |
| 2718 | face_change = false; | 2718 | face_change = false; |
| 2719 | XFRAME (w->frame)->face_change = 0; | ||
| 2719 | free_all_realized_faces (Qnil); | 2720 | free_all_realized_faces (Qnil); |
| 2720 | } | 2721 | } |
| 2721 | else if (XFRAME (w->frame)->face_change) | 2722 | else if (XFRAME (w->frame)->face_change) |
| @@ -14072,6 +14073,7 @@ redisplay_internal (void) | |||
| 14072 | /* Only GC scrollbars when we redisplay the whole frame. */ | 14073 | /* Only GC scrollbars when we redisplay the whole frame. */ |
| 14073 | = f->redisplay || !REDISPLAY_SOME_P (); | 14074 | = f->redisplay || !REDISPLAY_SOME_P (); |
| 14074 | bool f_redisplay_flag = f->redisplay; | 14075 | bool f_redisplay_flag = f->redisplay; |
| 14076 | bool f_garbaged_flag = FRAME_GARBAGED_P (f); | ||
| 14075 | /* Mark all the scroll bars to be removed; we'll redeem | 14077 | /* Mark all the scroll bars to be removed; we'll redeem |
| 14076 | the ones we want when we redisplay their windows. */ | 14078 | the ones we want when we redisplay their windows. */ |
| 14077 | if (gcscrollbars && FRAME_TERMINAL (f)->condemn_scroll_bars_hook) | 14079 | if (gcscrollbars && FRAME_TERMINAL (f)->condemn_scroll_bars_hook) |
| @@ -14132,6 +14134,15 @@ redisplay_internal (void) | |||
| 14132 | Therefore, we must redisplay this frame. */ | 14134 | Therefore, we must redisplay this frame. */ |
| 14133 | if (!f_redisplay_flag && f->redisplay) | 14135 | if (!f_redisplay_flag && f->redisplay) |
| 14134 | goto retry_frame; | 14136 | goto retry_frame; |
| 14137 | /* Likewise with the frame's garbaged flag: it can | ||
| 14138 | get set inside redisplay_windows if some hook | ||
| 14139 | winds up calling adjust_frame_glyphs, for example. */ | ||
| 14140 | if (!f_garbaged_flag && FRAME_GARBAGED_P (f)) | ||
| 14141 | { | ||
| 14142 | f->garbaged = false; | ||
| 14143 | fset_redisplay (f); | ||
| 14144 | goto retry_frame; | ||
| 14145 | } | ||
| 14135 | 14146 | ||
| 14136 | /* In some case (e.g., window resize), we notice | 14147 | /* In some case (e.g., window resize), we notice |
| 14137 | only during window updating that the window | 14148 | only during window updating that the window |