summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@gnome.org>2021-01-07 10:26:03 -0600
committerMichael Catanzaro <mcatanzaro@gnome.org>2021-01-07 11:39:41 -0600
commitb26348710d1872c0103f5ca74d46412f6fe544c4 (patch)
tree9ae5f8586531f91145712629993a945e44b73b59
parentdb059847b246fbea1e6db0b38db9aaeec7ab4e36 (diff)
downloadgtk+-mcatanzaro/unparent-warning.tar.gz
listbox: unparent new header only if it has a parentmcatanzaro/unparent-warning
It's no longer OK to unparent a widget that has no parent.
-rw-r--r--gtk/gtklistbox.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index 72bc7c8539..a960793707 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -2232,7 +2232,8 @@ gtk_list_box_update_header (GtkListBox *box,
if (new_header != NULL)
{
g_hash_table_insert (box->header_hash, new_header, row);
- gtk_widget_unparent (new_header);
+ if (gtk_widget_get_parent (new_header) != NULL)
+ gtk_widget_unparent (new_header);
gtk_widget_set_parent (new_header, GTK_WIDGET (box));
gtk_widget_show (new_header);
}