summaryrefslogtreecommitdiff
path: root/telepathy-glib/base-connection.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2010-11-03 17:59:15 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2010-11-03 17:59:15 +0000
commit2444ca1eb8a9037599f6977f8bad97139b8fdbd2 (patch)
tree26e8e2862d59d9910bc39e068490b6efbc899235 /telepathy-glib/base-connection.c
parent7931c481607e64ee22b4fe155a353f03e5e345ec (diff)
downloadtelepathy-glib-2444ca1eb8a9037599f6977f8bad97139b8fdbd2.tar.gz
fd.o #10613: tp_base_connection_unregister: release object path before bus name
We're effectively using the bus name as a mutex to protect the object path, because dbus-glib doesn't have failable object path acquisition. Now that we (can) explicitly remove the object from the bus, we can do that properly, fixing a longstanding bug.
Diffstat (limited to 'telepathy-glib/base-connection.c')
-rw-r--r--telepathy-glib/base-connection.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c
index 4ce1b585b..39c042595 100644
--- a/telepathy-glib/base-connection.c
+++ b/telepathy-glib/base-connection.c
@@ -551,11 +551,16 @@ tp_base_connection_unregister (TpBaseConnection *self)
GHashTableIter iter;
gpointer k;
+ if (priv->been_registered)
+ tp_dbus_daemon_unregister_object (priv->bus_proxy, self);
+
if (self->bus_name != NULL)
{
tp_dbus_daemon_release_name (priv->bus_proxy, self->bus_name, NULL);
}
+ priv->been_registered = FALSE;
+
g_hash_table_iter_init (&iter, self->priv->interested_clients);
while (g_hash_table_iter_next (&iter, &k, NULL))
@@ -564,11 +569,6 @@ tp_base_connection_unregister (TpBaseConnection *self)
tp_base_connection_interested_name_owner_changed_cb, self);
g_hash_table_iter_remove (&iter);
}
-
- if (priv->been_registered)
- tp_dbus_daemon_unregister_object (priv->bus_proxy, self);
-
- priv->been_registered = FALSE;
}
}