aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2025-03-22 21:32:16 +0200
committerEli Zaretskii2025-03-22 21:32:16 +0200
commit62368f93a5d2cf1b961626c705c032e15b1d5f43 (patch)
tree8e0ec0a1856ef66bf290d192fcc8403e56be9043 /src
parent25d757535884da71ace29fd80b8b24dd3a8f9017 (diff)
downloademacs-62368f93a5d2cf1b961626c705c032e15b1d5f43.tar.gz
emacs-62368f93a5d2cf1b961626c705c032e15b1d5f43.zip
Avoid rare segfaults due to crazy creation of new child frames
* src/dispnew.c (combine_updates, combine_updates_for_frame): Skip frames and child frames that were not yet completely made. (Bug#77046)
Diffstat (limited to 'src')
-rw-r--r--src/dispnew.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index d97dbfa6d1e..6365dcb9c4d 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -4018,6 +4018,9 @@ combine_updates_for_frame (struct frame *f, bool inhibit_scrolling)
4018{ 4018{
4019 struct frame *root = root_frame (f); 4019 struct frame *root = root_frame (f);
4020 4020
4021 if (!root->after_make_frame)
4022 return;
4023
4021 /* Determine visible frames on the root frame, including the root 4024 /* Determine visible frames on the root frame, including the root
4022 frame itself. Note that there are cases, see bug#75056, where we 4025 frame itself. Note that there are cases, see bug#75056, where we
4023 can be called for invisible frames. This looks like a bug with 4026 can be called for invisible frames. This looks like a bug with
@@ -4036,7 +4039,8 @@ combine_updates_for_frame (struct frame *f, bool inhibit_scrolling)
4036 for (Lisp_Object tail = XCDR (z_order); CONSP (tail); tail = XCDR (tail)) 4039 for (Lisp_Object tail = XCDR (z_order); CONSP (tail); tail = XCDR (tail))
4037 { 4040 {
4038 topmost_child = XFRAME (XCAR (tail)); 4041 topmost_child = XFRAME (XCAR (tail));
4039 copy_child_glyphs (root, topmost_child); 4042 if (topmost_child->after_make_frame)
4043 copy_child_glyphs (root, topmost_child);
4040 } 4044 }
4041 4045
4042 update_begin (root); 4046 update_begin (root);
@@ -4089,7 +4093,8 @@ combine_updates (Lisp_Object roots)
4089 for (; CONSP (roots); roots = XCDR (roots)) 4093 for (; CONSP (roots); roots = XCDR (roots))
4090 { 4094 {
4091 struct frame *root = XFRAME (XCAR (roots)); 4095 struct frame *root = XFRAME (XCAR (roots));
4092 combine_updates_for_frame (root, false); 4096 if (root->after_make_frame)
4097 combine_updates_for_frame (root, false);
4093 } 4098 }
4094} 4099}
4095 4100