summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5Dint.c7
-rw-r--r--src/H5G.c7
-rw-r--r--src/H5T.c5
3 files changed, 17 insertions, 2 deletions
diff --git a/src/H5Dint.c b/src/H5Dint.c
index e51f001..891b3a6 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -1457,9 +1457,14 @@ H5D_close(H5D_t *dataset)
HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't decrement count for object")
/* Check reference count for this object in the top file */
- if(H5FO_top_count(dataset->oloc.file, dataset->oloc.addr) == 0)
+ if(H5FO_top_count(dataset->oloc.file, dataset->oloc.addr) == 0) {
if(H5O_close(&(dataset->oloc)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to close")
+ } /* end if */
+ else
+ /* Free object location (i.e. "unhold" the file if appropriate) */
+ if(H5O_loc_free(&(dataset->oloc)) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "problem attempting to free location")
} /* end else */
/* Release the dataset's path info */
diff --git a/src/H5G.c b/src/H5G.c
index 5c7741c..1f561bd 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -1181,9 +1181,14 @@ H5G_close(H5G_t *grp)
HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't decrement count for object")
/* Check reference count for this object in the top file */
- if(H5FO_top_count(grp->oloc.file, grp->oloc.addr) == 0)
+ if(H5FO_top_count(grp->oloc.file, grp->oloc.addr) == 0) {
if(H5O_close(&(grp->oloc)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to close")
+ } /* end if */
+ else
+ /* Free object location (i.e. "unhold" the file if appropriate) */
+ if(H5O_loc_free(&(grp->oloc)) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "problem attempting to free location")
/* If this group is a mount point and the mount point is the last open
* reference to the group, then attempt to close down the file hierarchy
diff --git a/src/H5T.c b/src/H5T.c
index 25b241b..a34783a 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -3594,6 +3594,11 @@ H5T_close(H5T_t *dt)
if(H5O_close(&dt->oloc) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to close")
} /* end if */
+ else
+ /* Free object location (i.e. "unhold" the file if appropriate)
+ */
+ if(H5O_loc_free(&(dt->oloc)) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "problem attempting to free location")
} /* end if */
/* Free the group hier. path since we're not calling H5T_free*/