[gtk/matthiasc/for-master: 2/12] columviewsorter: Add an assertion
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 2/12] columviewsorter: Add an assertion
- Date: Thu, 16 Jul 2020 12:55:06 +0000 (UTC)
commit f54ed6f7dca0e689cb3cd5f5754451018a46fee8
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Jul 16 07:49:18 2020 -0400
columviewsorter: Add an assertion
gtk/gtkcolumnviewsorter.c | 8 ++++++++
1 file changed, 8 insertions(+)
---
diff --git a/gtk/gtkcolumnviewsorter.c b/gtk/gtkcolumnviewsorter.c
index 587731e1cd..fa8cf8607a 100644
--- a/gtk/gtkcolumnviewsorter.c
+++ b/gtk/gtkcolumnviewsorter.c
@@ -115,6 +115,14 @@ gtk_column_view_sorter_dispose (GObject *object)
{
GtkColumnViewSorter *self = GTK_COLUMN_VIEW_SORTER (object);
+ /* The sorter is owned by the columview and is unreffed
+ * after the columns, so the sequence must be empty at
+ * this point.
+ * The sorter can outlive the columview it comes from
+ * (the model might still have a ref), but that does
+ * not change the fact that all columns will be gone.
+ */
+ g_assert (g_sequence_is_empty (self->sorters));
g_clear_pointer (&self->sorters, g_sequence_free);
G_OBJECT_CLASS (gtk_column_view_sorter_parent_class)->dispose (object);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]