diff options
-rw-r--r-- | telepathy-glib/base-client.c | 17 | ||||
-rw-r--r-- | tests/dbus/simple-handler.c | 16 |
2 files changed, 22 insertions, 11 deletions
diff --git a/telepathy-glib/base-client.c b/telepathy-glib/base-client.c index 29be3e224..179a14855 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,7 +1874,9 @@ ctx_done_cb (TpHandleChannelsContext *context, if (tp_proxy_get_invalidated (channel) == NULL) { - g_hash_table_insert (self->priv->my_chans, + DEBUG ("Inserting Channel (%p) %s", + channel, tp_proxy_get_object_path (channel)); + g_hash_table_replace (self->priv->my_chans, (gchar *) tp_proxy_get_object_path (channel), g_object_ref (channel)); diff --git a/tests/dbus/simple-handler.c b/tests/dbus/simple-handler.c index 1b6d67f97..461667cb1 100644 --- a/tests/dbus/simple-handler.c +++ b/tests/dbus/simple-handler.c @@ -377,6 +377,7 @@ call_handle_channels (Test *test) { GPtrArray *channels, *requests_satisified; GHashTable *info; + int i; channels = g_ptr_array_sized_new (1); add_channel_to_ptr_array (channels, test->text_chan); @@ -387,13 +388,16 @@ call_handle_channels (Test *test) tp_proxy_add_interface_by_id (TP_PROXY (test->client), TP_IFACE_QUARK_CLIENT_HANDLER); - tp_cli_client_handler_call_handle_channels (test->client, -1, - tp_proxy_get_object_path (test->account), - tp_proxy_get_object_path (test->connection), - channels, requests_satisified, 0, info, - no_return_cb, test, NULL, NULL); + for (i = 0 ; i < 10 ; i ++) + { + tp_cli_client_handler_call_handle_channels (test->client, -1, + tp_proxy_get_object_path (test->account), + tp_proxy_get_object_path (test->connection), + channels, requests_satisified, 0, info, + no_return_cb, test, NULL, NULL); - g_main_loop_run (test->mainloop); + g_main_loop_run (test->mainloop); + } g_ptr_array_foreach (channels, free_channel_details, NULL); g_ptr_array_free (channels, TRUE); |