From 0ce04c0eeb44897218a7ea4d9d6443144c6a6872 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Thu, 9 Feb 2017 11:05:34 -0200 Subject: [PATCH] application: don't remove providers from screen when finalizing When finalizing the application, it is possible that the main window had already been destroyed and the Gtk+ CSS machinery to stop working. We currently try to remove the CSS providers from screen when finalizing, which (i) has no effect, and (ii) causes a segfault. Fix that by simply destroying the CSS providers, and not trying to remove them on finalize. https://bugzilla.gnome.org/show_bug.cgi?id=773871 --- src/gcal-application.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/gcal-application.c b/src/gcal-application.c index 4ee4cae8..52f2c3ca 100644 --- a/src/gcal-application.c +++ b/src/gcal-application.c @@ -207,15 +207,8 @@ gcal_application_finalize (GObject *object) g_free (self->uuid); g_clear_pointer (&self->initial_date, g_free); - if (self->provider != NULL) - { - gtk_style_context_remove_provider_for_screen (gdk_screen_get_default (), GTK_STYLE_PROVIDER (self->colors_provider)); - - gtk_style_context_remove_provider_for_screen (gdk_screen_get_default (), GTK_STYLE_PROVIDER (self->provider)); - g_clear_object (&(self->provider)); - } - g_clear_object (&self->colors_provider); + g_clear_object (&(self->provider)); g_clear_object (&self->settings); g_clear_object (&self->manager);