* libsoup/soup-session.c (cleanup_hosts): Don't free the hosts
while holding host_lock; that's not allowed and can cause
deadlock. #309867. Based on a patch from Veerapuram Varadhan for
part of bnc #174255.
+2006-05-22 Dan Winship <danw@novell.com>
+
+ * libsoup/soup-session.c (cleanup_hosts): Don't free the hosts
+ while holding host_lock; that's not allowed and can cause
+ deadlock. #309867. Based on a patch from Veerapuram Varadhan for
+ part of bnc #174255.
+
2006-04-10 Dan Winship <danw@novell.com>
* configure.in: bump version to 2.2.92
static void
cleanup_hosts (SoupSessionPrivate *priv)
{
+ GHashTable *old_hosts;
+
g_mutex_lock (priv->host_lock);
- g_hash_table_foreach_remove (priv->hosts, foreach_free_host, NULL);
+ old_hosts = priv->hosts;
+ priv->hosts = g_hash_table_new (host_uri_hash, host_uri_equal);
g_mutex_unlock (priv->host_lock);
+
+ g_hash_table_foreach_remove (old_hosts, foreach_free_host, NULL);
+ g_hash_table_destroy (old_hosts);
}
static void