summaryrefslogtreecommitdiffstats
path: root/src/H5Tref.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2021-01-22 21:05:39 (GMT)
committerGitHub <noreply@github.com>2021-01-22 21:05:39 (GMT)
commita8ee85971b4251a3383d82fdd68bf150e0acad39 (patch)
tree093c3211e458370a30b3dca604bb86517a64ae91 /src/H5Tref.c
parent672892cc0ed458b30ad60b02e38c92c680468800 (diff)
downloadhdf5-a8ee85971b4251a3383d82fdd68bf150e0acad39.zip
hdf5-a8ee85971b4251a3383d82fdd68bf150e0acad39.tar.gz
hdf5-a8ee85971b4251a3383d82fdd68bf150e0acad39.tar.bz2
Fix problems with vlens and refs inside compound using H5VLget_file_type() (#274)hdf5-1_13_0-rc5
* Fixed problems with vlens and refs inside compound using H5VLget_file_type() * Fix date in RELEASE.txt * Add assertions * Move some manipulation of H5VL_object_t struct fields into the H5VL package.
Diffstat (limited to 'src/H5Tref.c')
-rw-r--r--src/H5Tref.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/H5Tref.c b/src/H5Tref.c
index 8d7dca2..9c6477b 100644
--- a/src/H5Tref.c
+++ b/src/H5Tref.c
@@ -156,7 +156,7 @@ static const H5T_ref_class_t H5T_ref_dsetreg_disk_g = {
*-------------------------------------------------------------------------
*/
htri_t
-H5T__ref_set_loc(const H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc)
+H5T__ref_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc)
{
htri_t ret_value = FALSE; /* Indicate success, but no location change */
@@ -180,6 +180,13 @@ H5T__ref_set_loc(const H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc)
/* Mark this type as being stored in memory */
dt->shared->u.atomic.u.r.loc = H5T_LOC_MEMORY;
+ /* Release owned file */
+ if (dt->shared->owned_vol_obj) {
+ if(H5VL_free_object(dt->shared->owned_vol_obj) < 0)
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCLOSEOBJ, FAIL, "unable to close owned VOL object")
+ dt->shared->owned_vol_obj = NULL;
+ } /* end if */
+
/* Reset file ID (since this reference is in memory) */
dt->shared->u.atomic.u.r.file = file; /* file is NULL */
@@ -220,6 +227,10 @@ H5T__ref_set_loc(const H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc)
/* Set file pointer (since this reference is on disk) */
dt->shared->u.atomic.u.r.file = file;
+ /* dt now owns a reference to file */
+ if (H5T_own_vol_obj(dt, file) < 0)
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "can't give ownership of VOL object")
+
if (dt->shared->u.atomic.u.r.rtype == H5R_OBJECT1) {
H5F_t *f;