[evolution-rss] do not modify hash while iterating over it
- From: Lucian Langa <lucilanga src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-rss] do not modify hash while iterating over it
- Date: Thu, 8 Sep 2011 21:45:31 +0000 (UTC)
commit e430f85fc43160fd6adc7776f3d9cb32e37d69ab
Author: Lucian Langa <lucilanga gnome org>
Date: Thu Sep 8 23:45:28 2011 +0200
do not modify hash while iterating over it
src/network-soup.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/src/network-soup.c b/src/network-soup.c
index 52c5ec3..11b4c15 100644
--- a/src/network-soup.c
+++ b/src/network-soup.c
@@ -181,7 +181,6 @@ static gboolean
remove_if_match (gpointer key, gpointer value, gpointer user_data)
{
if (value == user_data) {
- g_hash_table_remove(rf->key_session, key);
return TRUE;
} else
return FALSE;
@@ -203,9 +202,8 @@ unblock_free (gpointer user_data, GObject *ex_msg)
g_hash_table_destroy(rf->abort_session);
rf->abort_session = g_hash_table_new(g_direct_hash, g_direct_equal);
g_hash_table_foreach(rf->session, construct_abort, NULL);
- g_hash_table_find(rf->key_session,
- remove_if_match,
- user_data);
+ g_hash_table_foreach_remove(rf->key_session,
+ remove_if_match, user_data);
//this has been moved to soup-internal
/*gboolean prune = soup_session_try_prune_connection (user_data);
if (prune)
@@ -1113,9 +1111,8 @@ abort_soup_sess(gpointer key, gpointer value, gpointer user_data)
{
if (key && SOUP_IS_SESSION(key)) {
soup_session_abort(key);
- g_hash_table_find(rf->key_session,
- remove_if_match,
- user_data);
+ g_hash_table_foreach_remove(rf->key_session,
+ remove_if_match, user_data);
}
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]