From fa06cfbd780c0a36aa93c85d8fe792ea0883f925 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 7 Sep 2011 16:14:08 +0200 Subject: [PATCH] gcr: Fix null pointer dereference when finalizing GcrCollectionModel --- gcr/gcr-collection-model.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gcr/gcr-collection-model.c b/gcr/gcr-collection-model.c index 78b2221..e46bf51 100644 --- a/gcr/gcr-collection-model.c +++ b/gcr/gcr-collection-model.c @@ -1200,10 +1200,11 @@ gcr_collection_model_finalize (GObject *object) g_assert (g_hash_table_size (self->pv->object_to_seq) == 0); g_hash_table_destroy (self->pv->object_to_seq); - g_assert (g_hash_table_size (self->pv->selected) == 0); - if (self->pv->selected) + if (self->pv->selected) { + g_assert (g_hash_table_size (self->pv->selected) == 0); g_hash_table_destroy (self->pv->selected); - self->pv->selected = NULL; + self->pv->selected = NULL; + } self->pv->columns = NULL; for (i = 0; i < self->pv->n_columns; i++) -- 2.7.4