columnview: Clear the sorter first thing in dispose
authorBenjamin Otte <otte@redhat.com>
Fri, 3 Mar 2023 02:05:22 +0000 (03:05 +0100)
committerBenjamin Otte <otte.benjamin@googlemail.com>
Sun, 5 Mar 2023 15:23:20 +0000 (15:23 +0000)
Otherwise, when removing the columns, each column will trigger a
sorter::changed signal emission.

And because sorters are often still connected to a sortlistmodel, we
can't skip that emission and need to do it.
But we only need to do it once.

gtk/gtkcolumnview.c

index 95fb02d8eb3f73286304c9d24be3ac85bd630c13..33fe678c8e460c16f2b420d028e61befd4e63d4b 100644 (file)
@@ -477,6 +477,8 @@ gtk_column_view_dispose (GObject *object)
 {
   GtkColumnView *self = GTK_COLUMN_VIEW (object);
 
+  gtk_column_view_sorter_clear (GTK_COLUMN_VIEW_SORTER (self->sorter));
+
   while (g_list_model_get_n_items (G_LIST_MODEL (self->columns)) > 0)
     {
       GtkColumnViewColumn *column = g_list_model_get_item (G_LIST_MODEL (self->columns), 0);