Merge branch 'unroot' into 'main'

gtkcolumnviewcellwidget: move cleanup from dispose to unroot

Closes #6200

See merge request GNOME/gtk!6758
This commit is contained in:
Benjamin Otte 2024-01-15 14:13:09 +00:00
commit 1dd5e92499

View File

@ -270,9 +270,9 @@ gtk_column_view_cell_widget_size_allocate (GtkWidget *widget,
} }
static void static void
gtk_column_view_cell_widget_dispose (GObject *object) gtk_column_view_cell_widget_unroot (GtkWidget *widget)
{ {
GtkColumnViewCellWidget *self = GTK_COLUMN_VIEW_CELL_WIDGET (object); GtkColumnViewCellWidget *self = GTK_COLUMN_VIEW_CELL_WIDGET (widget);
if (self->column) if (self->column)
{ {
@ -289,7 +289,7 @@ gtk_column_view_cell_widget_dispose (GObject *object)
g_clear_object (&self->column); g_clear_object (&self->column);
} }
G_OBJECT_CLASS (gtk_column_view_cell_widget_parent_class)->dispose (object); GTK_WIDGET_CLASS (gtk_column_view_cell_widget_parent_class)->unroot (widget);
} }
static GtkSizeRequestMode static GtkSizeRequestMode
@ -308,7 +308,6 @@ gtk_column_view_cell_widget_class_init (GtkColumnViewCellWidgetClass *klass)
{ {
GtkListFactoryWidgetClass *factory_class = GTK_LIST_FACTORY_WIDGET_CLASS (klass); GtkListFactoryWidgetClass *factory_class = GTK_LIST_FACTORY_WIDGET_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
factory_class->create_object = gtk_column_view_cell_widget_create_object; factory_class->create_object = gtk_column_view_cell_widget_create_object;
factory_class->setup_object = gtk_column_view_cell_widget_setup_object; factory_class->setup_object = gtk_column_view_cell_widget_setup_object;
@ -320,8 +319,8 @@ gtk_column_view_cell_widget_class_init (GtkColumnViewCellWidgetClass *klass)
widget_class->measure = gtk_column_view_cell_widget_measure; widget_class->measure = gtk_column_view_cell_widget_measure;
widget_class->size_allocate = gtk_column_view_cell_widget_size_allocate; widget_class->size_allocate = gtk_column_view_cell_widget_size_allocate;
widget_class->get_request_mode = gtk_column_view_cell_widget_get_request_mode; widget_class->get_request_mode = gtk_column_view_cell_widget_get_request_mode;
widget_class->unroot = gtk_column_view_cell_widget_unroot;
gobject_class->dispose = gtk_column_view_cell_widget_dispose;
gtk_widget_class_set_css_name (widget_class, I_("cell")); gtk_widget_class_set_css_name (widget_class, I_("cell"));
gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_GRID_CELL); gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_GRID_CELL);