From: Stef Walter Date: Mon, 11 Oct 2010 00:37:24 +0000 (+0000) Subject: [gcr] Fix broken dispose of GcrCertificateWidget X-Git-Tag: split~233 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ebef3a7c6f415e604e5de34c79f18e4fe7e07825;p=platform%2Fupstream%2Fgcr.git [gcr] Fix broken dispose of GcrCertificateWidget Dispose and finalize of the gcr widgets was broken. https://bugzilla.gnome.org/show_bug.cgi?id=631840 --- diff --git a/gcr/gcr-display-view.c b/gcr/gcr-display-view.c index 2871fc0..3f0807d 100644 --- a/gcr/gcr-display-view.c +++ b/gcr/gcr-display-view.c @@ -347,10 +347,6 @@ _gcr_display_view_dispose (GObject *obj) GcrRenderer *renderer; GcrDisplayItem *item; - if (self->pv->buffer) - g_object_unref (self->pv->buffer); - self->pv->buffer = NULL; - while (self->pv->renderers->len) { renderer = g_ptr_array_index (self->pv->renderers, 0); item = g_hash_table_lookup (self->pv->items, renderer); @@ -361,9 +357,13 @@ _gcr_display_view_dispose (GObject *obj) g_ptr_array_remove_index_fast (self->pv->renderers, 0); } + if (self->pv->buffer) + g_object_unref (self->pv->buffer); + self->pv->buffer = NULL; + g_assert (g_hash_table_size (self->pv->items) == 0); - G_OBJECT_CLASS (_gcr_display_view_parent_class)->finalize (obj); + G_OBJECT_CLASS (_gcr_display_view_parent_class)->dispose (obj); } static void diff --git a/gcr/tests/ui-test-certificate.c b/gcr/tests/ui-test-certificate.c index bf12e72..3b741b5 100644 --- a/gcr/tests/ui-test-certificate.c +++ b/gcr/tests/ui-test-certificate.c @@ -50,9 +50,9 @@ on_parser_parsed (GcrParser *parser, gpointer unused) gtk_window_set_default_size (GTK_WINDOW (dialog), 550, 400); gtk_container_set_border_width (GTK_CONTAINER (dialog), 20); gtk_dialog_run (dialog); + gtk_widget_destroy (GTK_WIDGET (dialog)); g_object_unref (dialog); - g_object_unref (details); } static void