diff --git a/gtk/gtktreelistmodel.c b/gtk/gtktreelistmodel.c index 81b4319c15..a4f0fa1d4b 100644 --- a/gtk/gtktreelistmodel.c +++ b/gtk/gtktreelistmodel.c @@ -415,10 +415,16 @@ gtk_tree_list_model_clear_node (gpointer data) TreeNode *node = data; if (node->row) - gtk_tree_list_row_destroy (node->row); + { + g_object_freeze_notify (G_OBJECT (node->row)); + gtk_tree_list_row_destroy (node->row); + } gtk_tree_list_model_clear_node_children (node); + if (node->row) + g_object_thaw_notify (G_OBJECT (node->row)); + g_clear_object (&node->item); } @@ -955,16 +961,12 @@ G_DEFINE_TYPE (GtkTreeListRow, gtk_tree_list_row, G_TYPE_OBJECT) static void gtk_tree_list_row_destroy (GtkTreeListRow *self) { - g_object_freeze_notify (G_OBJECT (self)); - self->node = NULL; /* FIXME: We could check some properties to avoid excess notifies */ g_object_notify_by_pspec (G_OBJECT (self), row_properties[ROW_PROP_DEPTH]); g_object_notify_by_pspec (G_OBJECT (self), row_properties[ROW_PROP_EXPANDABLE]); g_object_notify_by_pspec (G_OBJECT (self), row_properties[ROW_PROP_EXPANDED]); - - g_object_thaw_notify (G_OBJECT (self)); } static void