From 323adf9aa8a3025ae1c1518c1dab73f65294bb7d Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 16 Jan 2024 06:59:15 +0100 Subject: [PATCH] Revert "gtkcolumnviewcellwidget: move cleanup from dispose to unroot" This reverts commit ff262c081ef2b4bd2bcda3b52a5d8a53935ab470. This is a wrong fix because it triggers when the columnview gets unrooted but the cell keeps existing. Later, when the columnview gets re-rooted, the cell is still there but thinks it has no column. And that's bad. --- gtk/gtkcolumnviewcellwidget.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gtk/gtkcolumnviewcellwidget.c b/gtk/gtkcolumnviewcellwidget.c index 9b9ff79050..eb3ab7835e 100644 --- a/gtk/gtkcolumnviewcellwidget.c +++ b/gtk/gtkcolumnviewcellwidget.c @@ -270,9 +270,9 @@ gtk_column_view_cell_widget_size_allocate (GtkWidget *widget, } static void -gtk_column_view_cell_widget_unroot (GtkWidget *widget) +gtk_column_view_cell_widget_dispose (GObject *object) { - GtkColumnViewCellWidget *self = GTK_COLUMN_VIEW_CELL_WIDGET (widget); + GtkColumnViewCellWidget *self = GTK_COLUMN_VIEW_CELL_WIDGET (object); if (self->column) { @@ -289,7 +289,7 @@ gtk_column_view_cell_widget_unroot (GtkWidget *widget) g_clear_object (&self->column); } - GTK_WIDGET_CLASS (gtk_column_view_cell_widget_parent_class)->unroot (widget); + G_OBJECT_CLASS (gtk_column_view_cell_widget_parent_class)->dispose (object); } static GtkSizeRequestMode @@ -308,6 +308,7 @@ gtk_column_view_cell_widget_class_init (GtkColumnViewCellWidgetClass *klass) { GtkListFactoryWidgetClass *factory_class = GTK_LIST_FACTORY_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->setup_object = gtk_column_view_cell_widget_setup_object; @@ -319,8 +320,8 @@ gtk_column_view_cell_widget_class_init (GtkColumnViewCellWidgetClass *klass) widget_class->measure = gtk_column_view_cell_widget_measure; 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->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_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_GRID_CELL);