summaryrefslogtreecommitdiffstats
path: root/src/H5I.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2013-10-07 19:35:12 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2013-10-07 19:35:12 (GMT)
commit53827d4017a258a6e4bfd911d4fef3fbc21bd484 (patch)
treef790ba3024a6048b2cac74371cdd57ae84dc6fac /src/H5I.c
parent5f2a34b462bcbbe73befa3730b6f327f6a5695fe (diff)
downloadhdf5-53827d4017a258a6e4bfd911d4fef3fbc21bd484.zip
hdf5-53827d4017a258a6e4bfd911d4fef3fbc21bd484.tar.gz
hdf5-53827d4017a258a6e4bfd911d4fef3fbc21bd484.tar.bz2
[svn-r24261] Description:
Correct H5I use of skip list to acquire the 'next' pointer in the skip list after the ID's 'free' callback has been called, since it occasionally deletes the 'next' node. Also a little bit of code cleanup in other modules. Tested on: FreeBSD/32 8.2 (loyalty) w/gcc4.6, w/C++ & FORTRAN, in debug mode FreeBSD/64 8.2 (freedom) w/gcc4.6, w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (koala) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.11 (emu) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, w/threadsafe, in production mode Linux/PPC 2.6 (ostrich) w/C++ & FORTRAN, w/threadsafe, in debug mode
Diffstat (limited to 'src/H5I.c')
-rw-r--r--src/H5I.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/H5I.c b/src/H5I.c
index a830a26..21408af 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -562,9 +562,6 @@ H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref)
if(NULL == (cur = (H5I_id_info_t *)H5SL_item(curr_node)))
HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get ID info for node")
- /* Get the next node in the list */
- next_node = H5SL_next(curr_node);
-
/*
* Do nothing to the object if the reference count is larger than
* one and forcing is off.
@@ -598,13 +595,16 @@ H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref)
} /* end else */
} /* end else */
+ /* Get the next node in the list */
+ next_node = H5SL_next(curr_node);
+
/* Check if we should delete this node or not */
if(delete_node) {
/* Decrement the number of IDs in the type */
(type_ptr->id_count)--;
/* Remove the node from the list */
- if(NULL == H5SL_remove(type_ptr->ids, cur))
+ if(NULL == H5SL_remove(type_ptr->ids, &cur->id))
HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, FAIL, "can't remove ID node from skip list")
/* Free the node */