summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-08-08 18:57:10 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-08-08 18:57:10 (GMT)
commit5155912a82993a7797b90a72fce39eee9e66a63e (patch)
tree8877b0df5d88c75f9131f62188a8469bcf82f92f
parentd25aefd0f38c4447549caf8513a91e980818412d (diff)
downloadhdf5-5155912a82993a7797b90a72fce39eee9e66a63e.zip
hdf5-5155912a82993a7797b90a72fce39eee9e66a63e.tar.gz
hdf5-5155912a82993a7797b90a72fce39eee9e66a63e.tar.bz2
[svn-r7303] Purpose:
Code cleanup Description: Chase new error API usage Protect against the current ID getting deleted during iteration over an ID group. Platforms tested: h5committested
-rw-r--r--src/H5I.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/H5I.c b/src/H5I.c
index b23d0ea..b4b8323 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -549,7 +549,7 @@ H5I_destroy_group(H5I_type_t grp)
*/
if (1==grp_ptr->count) {
H5I_clear_group(grp, TRUE);
- H5E_clear(H5E_get_my_stack()); /*don't care about errors*/
+ H5E_clear(NULL); /*don't care about errors*/
H5MM_xfree(grp_ptr->id_list);
HDmemset (grp_ptr, 0, sizeof(*grp_ptr));
} else {
@@ -1068,6 +1068,7 @@ H5I_search(H5I_type_t grp, H5I_search_func_t func, void *key)
{
H5I_id_group_t *grp_ptr = NULL; /*ptr to the group */
H5I_id_info_t *id_ptr = NULL; /*ptr to the new ID */
+ H5I_id_info_t *next_id = NULL; /*ptr to the next ID */
unsigned i; /*counter */
void *ret_value = NULL; /*return value */
@@ -1084,9 +1085,10 @@ H5I_search(H5I_type_t grp, H5I_search_func_t func, void *key)
for (i=0; i<grp_ptr->hash_size; i++) {
id_ptr = grp_ptr->id_list[i];
while (id_ptr) {
+ next_id= id_ptr->next; /* Protect against ID being deleted in callback */
if ((*func)(id_ptr->obj_ptr, id_ptr->id, key))
HGOTO_DONE(id_ptr->obj_ptr); /*found the item*/
- id_ptr = id_ptr->next;
+ id_ptr = next_id;
}
}