summaryrefslogtreecommitdiffstats
path: root/src/H5Tcommit.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/H5Tcommit.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/H5Tcommit.c')
-rw-r--r--src/H5Tcommit.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c
index 41191fa..5ce6f3a 100644
--- a/src/H5Tcommit.c
+++ b/src/H5Tcommit.c
@@ -143,11 +143,8 @@ H5T__commit_api_common(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype")
/* Set up VOL object */
- if (NULL == (new_obj = H5FL_CALLOC(H5VL_object_t)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "can't allocate top object structure")
- new_obj->connector = (*vol_obj_ptr)->connector;
- new_obj->connector->nrefs++;
- new_obj->data = data;
+ if (NULL == (new_obj = H5VL_create_object(data, (*vol_obj_ptr)->connector)))
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "can't create VOL object for committed datatype")
/* Set the committed type object to the VOL connector pointer in the H5T_t struct */
dt->vol_obj = new_obj;
@@ -370,11 +367,8 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype")
/* Setup VOL object */
- if (NULL == (new_obj = H5FL_CALLOC(H5VL_object_t)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "can't allocate top object structure")
- new_obj->connector = vol_obj->connector;
- new_obj->connector->nrefs++;
- new_obj->data = dt;
+ if (NULL == (new_obj = H5VL_create_object(dt, vol_obj->connector)))
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "can't create VOL object for committed datatype")
/* Set the committed type object to the VOL connector pointer in the H5T_t struct */
type->vol_obj = new_obj;
@@ -1114,8 +1108,11 @@ H5T_open(const H5G_loc_t *loc)
done:
if (ret_value == NULL) {
if (dt) {
- if (shared_fo == NULL) /* Need to free shared fo */
+ if (shared_fo == NULL) { /* Need to free shared fo */
+ if (dt->shared->owned_vol_obj && H5VL_free_object(dt->shared->owned_vol_obj) < 0)
+ HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, NULL, "unable to close owned VOL object")
dt->shared = H5FL_FREE(H5T_shared_t, dt->shared);
+ } /* end if */
H5O_loc_free(&(dt->oloc));
H5G_name_free(&(dt->path));