From e14840bbc70978174a4a66dd1e67d7444de5d5a6 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Fri, 17 May 2013 09:35:18 -0400 Subject: manager: don't try to unexport objects on system bus after it closes When the main GDM manager object is finalized, it unexports any exported DBus ObjectManager objects. In many cases, the system bus is no longer around by the time the GDM manager object is finalized. Unexporting an object when the the bus connection is already closed will make GDBus blow an assertion (since it's already been implicitly unexported by virtue of being disconnected). This commit changes the GDM manager object's finalize method to avoid explicitly unexporting the objects in the above scenario. https://bugzilla.gnome.org/show_bug.cgi?id=700523 --- daemon/gdm-manager.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c index 74c6888f..17e8ca52 100644 --- a/daemon/gdm-manager.c +++ b/daemon/gdm-manager.c @@ -1160,12 +1160,14 @@ gdm_manager_finalize (GObject *object) G_CALLBACK (on_display_removed), manager); - gdm_display_store_foreach (manager->priv->display_store, - (GdmDisplayStoreFunc)unexport_display, - manager); - gdm_display_store_clear (manager->priv->display_store); + if (!g_dbus_connection_is_closed (manager->priv->connection)) { + gdm_display_store_foreach (manager->priv->display_store, + (GdmDisplayStoreFunc)unexport_display, + manager); + g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (manager)); + } - g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (manager)); + gdm_display_store_clear (manager->priv->display_store); g_dbus_object_manager_server_set_connection (manager->priv->object_manager, NULL); -- cgit v1.2.1