From 2507923ecddfafa04d804090fdf59360b70e9350 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 7 Oct 2008 16:43:43 +0100 Subject: Don't free handle-ref-tracking data structures until the connection is invalidated This avoids repeated alloc/free cycles if a connection oscillates between holding 0 and 1 handles. --- telepathy-glib/connection-handles.c | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'telepathy-glib/connection-handles.c') diff --git a/telepathy-glib/connection-handles.c b/telepathy-glib/connection-handles.c index f3c0671ea..a1b9064d7 100644 --- a/telepathy-glib/connection-handles.c +++ b/telepathy-glib/connection-handles.c @@ -296,28 +296,6 @@ tp_connection_unref_handles (TpConnection *self, tp_cli_connection_call_release_handles (self, -1, handle_type, unref, post_unref, unref, array_free_TRUE, NULL); } - - if (g_hash_table_size (refcounts) == 0) - { - g_hash_table_destroy (refcounts); - bucket->refcounts[handle_type] = NULL; - - for (i = 1; i < NUM_TP_HANDLE_TYPES; i++) - { - if (bucket->refcounts[handle_type] != NULL) - return; - } - - /* if still here, then there are no refs left on this connection */ - g_hash_table_remove (table, object_path); - - if (g_hash_table_size (table) == 0) - { - /* this calls the destructor, g_hash_table_destroy */ - dbus_connection_set_data (dbus_g_connection_get_connection ( - g_connection), connection_handle_refs_slot, NULL, NULL); - } - } } -- cgit v1.2.1