diff options
author | jhendersonHDF <jhenderson@hdfgroup.org> | 2021-02-10 00:41:49 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-10 00:41:49 (GMT) |
commit | 52ac74689a869b4ae40801e6096a1f037aad0081 (patch) | |
tree | 7ab018d0d693f395c1ba8f0f5e9efb30434bb528 /src | |
parent | bccf5b5c0864896a077f5d6ef43ec1410151e693 (diff) | |
download | hdf5-52ac74689a869b4ae40801e6096a1f037aad0081.zip hdf5-52ac74689a869b4ae40801e6096a1f037aad0081.tar.gz hdf5-52ac74689a869b4ae40801e6096a1f037aad0081.tar.bz2 |
Check for wrap context before unwrapping file VOL object in H5F__dest (#325)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Fint.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/H5Fint.c b/src/H5Fint.c index df53236..67245d5 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1602,8 +1602,16 @@ H5F__dest(H5F_t *f, hbool_t flush) f->open_name = (char *)H5MM_xfree(f->open_name); f->actual_name = (char *)H5MM_xfree(f->actual_name); if (f->vol_obj) { - if (NULL == H5VL_object_unwrap(f->vol_obj)) + void *vol_wrap_ctx = NULL; + + /* If a VOL wrapping context is available, retrieve it + * and unwrap file VOL object + */ + if (H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get VOL object wrap context") + if (vol_wrap_ctx && (NULL == H5VL_object_unwrap(f->vol_obj))) HDONE_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't unwrap VOL object") + if (H5VL_free_object(f->vol_obj) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "unable to free VOL object") f->vol_obj = NULL; |