summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2010-12-18 14:58:35 +0000
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2010-12-20 14:18:13 +0000
commite333114732f77e3cf6bd2faedf78c7fb71bda543 (patch)
tree80be4f8955255c9d6aa6229b6680b78fe6850fd7
parentbc129171d0ca02c3132e675d97914a04db5bc64c (diff)
Better debug info and don't remove already removed channels
TpProxy has the bad habit of emitting signals from dispose (Booo!). TpBaseClient in various cases will be the last holder of a reference and tries to remove the channel from its hash-table on invalidated.. So in case the proxy gets unreferenced because it is removed from the hash table (because HandleChannels is called again with the same path), the proxy is disposed, it signals invalidated (Boo!) and during the removal it gets removed again and thus unreferenced again...
-rw-r--r--telepathy-glib/base-client.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/telepathy-glib/base-client.c b/telepathy-glib/base-client.c
index 29be3e224..2771976df 100644
--- a/telepathy-glib/base-client.c
+++ b/telepathy-glib/base-client.c
@@ -918,7 +918,8 @@ tp_base_client_dispose (GObject *object)
if (self->priv->my_chans != NULL &&
g_hash_table_size (self->priv->my_chans) > 0)
- WARNING ("TpBaseClient is still handling channels at dispose");
+ WARNING ("TpBaseClient is still handling %d channels at dispose",
+ g_hash_table_size (self->priv->my_chans));
tp_clear_pointer (&self->priv->my_chans, g_hash_table_unref);
@@ -1851,10 +1852,14 @@ chan_invalidated_cb (TpChannel *channel,
gchar *message,
TpBaseClient *self)
{
- DEBUG ("Channel %s has been invalidated", tp_proxy_get_object_path (channel));
+ DEBUG ("Channel (%p) %s has been invalidated (%s)",
+ channel, tp_proxy_get_object_path (channel), message);
- g_hash_table_remove (self->priv->my_chans, tp_proxy_get_object_path (
- channel));
+ if (!(domain == TP_DBUS_ERRORS && code == TP_DBUS_ERROR_PROXY_UNREFERENCED))
+ {
+ g_hash_table_remove (self->priv->my_chans, tp_proxy_get_object_path (
+ channel));
+ }
}
static void
@@ -1869,6 +1874,8 @@ ctx_done_cb (TpHandleChannelsContext *context,
if (tp_proxy_get_invalidated (channel) == NULL)
{
+ DEBUG ("Inserting Channel (%p) %s",
+ channel, tp_proxy_get_object_path (channel));
g_hash_table_insert (self->priv->my_chans,
(gchar *) tp_proxy_get_object_path (channel),
g_object_ref (channel));