diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index a6124cc800..4a936bf5b4 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -4011,17 +4011,23 @@ gtk_places_sidebar_dispose (GObject *object) g_clear_object (&sidebar->shortcuts); #ifdef HAVE_CLOUDPROVIDERS - for (l = cloud_providers_collector_get_providers (sidebar->cloud_manager); - l != NULL; l = l->next) - { - g_signal_handlers_disconnect_by_data (l->data, sidebar); - } for (l = sidebar->unready_accounts; l != NULL; l = l->next) { g_signal_handlers_disconnect_by_data (l->data, sidebar); } g_list_free_full (sidebar->unready_accounts, g_object_unref); sidebar->unready_accounts = NULL; + if (sidebar->cloud_manager) + { + g_signal_handlers_disconnect_by_data (sidebar->cloud_manager, sidebar); + for (l = cloud_providers_collector_get_providers (sidebar->cloud_manager); + l != NULL; l = l->next) + { + g_signal_handlers_disconnect_by_data (l->data, sidebar); + } + g_object_unref (sidebar->cloud_manager); + sidebar->cloud_manager = NULL; + } #endif G_OBJECT_CLASS (gtk_places_sidebar_parent_class)->dispose (object); @@ -4034,10 +4040,6 @@ gtk_places_sidebar_finalize (GObject *object) g_clear_object (&sidebar->row_actions); -#ifdef HAVE_CLOUDPROVIDERS - g_clear_object (&sidebar->cloud_manager); -#endif - g_clear_pointer (&sidebar->swin, gtk_widget_unparent); G_OBJECT_CLASS (gtk_places_sidebar_parent_class)->finalize (object);