]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix a segfault due to failure to realize some faces
authorEli Zaretskii <eliz@gnu.org>
Sat, 25 Mar 2017 13:59:17 +0000 (16:59 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 25 Mar 2017 13:59:17 +0000 (16:59 +0300)
* 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.

src/xdisp.c

index 826684949272f46f6857324a541af0abb19eb694..32550523bc31216b700b34c9479e4ac376c01cb8 100644 (file)
@@ -2716,6 +2716,7 @@ init_iterator (struct it *it, struct window *w,
       if (face_change)
        {
          face_change = false;
+         XFRAME (w->frame)->face_change = 0;
          free_all_realized_faces (Qnil);
        }
       else if (XFRAME (w->frame)->face_change)
@@ -14072,6 +14073,7 @@ redisplay_internal (void)
                /* Only GC scrollbars when we redisplay the whole frame.  */
                = f->redisplay || !REDISPLAY_SOME_P ();
              bool f_redisplay_flag = f->redisplay;
+             bool f_garbaged_flag = FRAME_GARBAGED_P (f);
              /* Mark all the scroll bars to be removed; we'll redeem
                 the ones we want when we redisplay their windows.  */
              if (gcscrollbars && FRAME_TERMINAL (f)->condemn_scroll_bars_hook)
@@ -14132,6 +14134,15 @@ redisplay_internal (void)
                     Therefore, we must redisplay this frame.  */
                  if (!f_redisplay_flag && f->redisplay)
                     goto retry_frame;
+                 /* Likewise with the frame's garbaged flag: it can
+                    get set inside redisplay_windows if some hook
+                    winds up calling adjust_frame_glyphs, for example. */
+                 if (!f_garbaged_flag && FRAME_GARBAGED_P (f))
+                   {
+                     f->garbaged = false;
+                     fset_redisplay (f);
+                     goto retry_frame;
+                   }
 
                   /* In some case (e.g., window resize), we notice
                      only during window updating that the window