summaryrefslogtreecommitdiff
path: root/gtk/gtkmenusectionbox.c
diff options
context:
space:
mode:
authorKévin Commaille <zecakeh@tedomum.fr>2022-01-25 15:31:00 +0100
committerKévin Commaille <zecakeh@tedomum.fr>2022-01-25 15:31:00 +0100
commitaaba777ad08efdec3853321762f0de664cae6348 (patch)
tree2dbad16f778cd8338644fb75464f29f6553d2249 /gtk/gtkmenusectionbox.c
parent00ee7ffa6aad0a58c0399b46c0c950f127dafcae (diff)
downloadgtk+-aaba777ad08efdec3853321762f0de664cae6348.tar.gz
popovermenu: Fix crash when removing child
gtk_menu_section_box_remove_custom was looking in the wrong place for the stack ancestor, causing an assertion error.
Diffstat (limited to 'gtk/gtkmenusectionbox.c')
-rw-r--r--gtk/gtkmenusectionbox.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/gtkmenusectionbox.c b/gtk/gtkmenusectionbox.c
index 72ca8c8b1a..46df8a55f4 100644
--- a/gtk/gtkmenusectionbox.c
+++ b/gtk/gtkmenusectionbox.c
@@ -762,8 +762,11 @@ gtk_menu_section_box_remove_custom (GtkPopoverMenu *popover,
const char *id;
GtkWidget *slot;
- stack = gtk_popover_get_child (GTK_POPOVER (popover));
+ stack = gtk_popover_menu_get_stack (popover);
box = GTK_MENU_SECTION_BOX (gtk_stack_get_child_by_name (GTK_STACK (stack), "main"));
+ if (box == NULL)
+ return FALSE;
+
parent = gtk_widget_get_parent (child);
id = (const char *) g_object_get_data (G_OBJECT (parent), "slot-id");