diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2021-01-22 21:05:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-22 21:05:39 (GMT) |
commit | a8ee85971b4251a3383d82fdd68bf150e0acad39 (patch) | |
tree | 093c3211e458370a30b3dca604bb86517a64ae91 /src/H5Tvlen.c | |
parent | 672892cc0ed458b30ad60b02e38c92c680468800 (diff) | |
download | hdf5-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/H5Tvlen.c')
-rw-r--r-- | src/H5Tvlen.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index e2d8d2a..20dab84 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -245,7 +245,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5T__vlen_set_loc(const H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) +H5T__vlen_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) { H5VL_file_cont_info_t cont_info = {H5VL_CONTAINER_INFO_VERSION, 0, 0, 0}; htri_t ret_value = FALSE; /* Indicate success, but no location change */ @@ -282,6 +282,13 @@ H5T__vlen_set_loc(const H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) else HDassert(0 && "Invalid VL type"); + /* Release owned file */ + if (dt->shared->owned_vol_obj) { + if(H5VL_free_object(dt->shared->owned_vol_obj) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close owned VOL object") + dt->shared->owned_vol_obj = NULL; + } /* end if */ + /* Reset file pointer (since this VL is in memory) */ dt->shared->u.vlen.file = NULL; break; @@ -307,6 +314,10 @@ H5T__vlen_set_loc(const H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) /* Set file ID (since this VL is on disk) */ dt->shared->u.vlen.file = file; + + /* dt now owns a reference to file */ + if (H5T_own_vol_obj(dt, file) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't give ownership of VOL object") break; case H5T_LOC_BADLOC: |