summaryrefslogtreecommitdiffstats
path: root/src/H5I.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1999-08-17 19:44:03 (GMT)
committerRobb Matzke <matzke@llnl.gov>1999-08-17 19:44:03 (GMT)
commit0b7babc994e59b88a10fb55345159ea6951e72b1 (patch)
treeb7780802df93acfa6a6ed09d84b17002c516e599 /src/H5I.c
parentcc89b8a605dfc7370cb760e6c3d7339cbf1e9884 (diff)
downloadhdf5-0b7babc994e59b88a10fb55345159ea6951e72b1.zip
hdf5-0b7babc994e59b88a10fb55345159ea6951e72b1.tar.gz
hdf5-0b7babc994e59b88a10fb55345159ea6951e72b1.tar.bz2
[svn-r1573] Changes since 19990817
---------------------- ./src/H5D.c ./src/H5F.c ./src/H5Fistore.c ./src/H5Smpio.c Incorporated previous changes into MPIO special cases. These are mostly due to the fact that most of the members of the file->shared->fapl struct have been moved into the file->shared->file->shared struct (`file' is an H5F_t*). ./src/H5I.c Fixed a bug with closing the library w.r.t. the VFL stuff. The VFL layer introduced reference counts on object ID's and the library termination functions freed these objects in the wrong order. Now H5I_clear_group() does not normally remove objects with a reference count larger than one because it assumes that those objects are currently in use by the library.
Diffstat (limited to 'src/H5I.c')
-rw-r--r--src/H5I.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/H5I.c b/src/H5I.c
index dbdfa97..ff3b6c6 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -368,6 +368,13 @@ H5I_nmembers(H5I_type_t grp)
* failed is not removed. This function returns failure if
* items could not be removed.
*
+ * Robb Matzke, 1999-08-17
+ * If the object reference count is larger than one then it must
+ * be because the library is using the object internally. This
+ * happens for instance for file driver ID's which are stored in
+ * things like property lists, files, etc. Objects that have a
+ * reference count larger than one are not affected unless FORCE
+ * is non-zero.
*-------------------------------------------------------------------------
*/
herr_t
@@ -407,6 +414,12 @@ H5I_clear_group(H5I_type_t grp, hbool_t force)
*/
for (i=0; i<grp_ptr->hash_size; i++) {
for (cur=grp_ptr->id_list[i]; cur; cur=next) {
+ /*
+ * Do nothing to the object if the reference count is larger than
+ * one and forcing is off.
+ */
+ if (!force && cur->count>1) continue;
+
/* Free the object regardless of reference count */
if (grp_ptr->free_func && (grp_ptr->free_func)(cur->obj_ptr)<0) {
if (force) {