columnview: Clear the sorter first thing in dispose

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.
This commit is contained in:
Benjamin Otte 2023-03-03 03:05:22 +01:00 committed by Benjamin Otte
parent b488fae893
commit 882dcda53b

View 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);