diff options
author | Chris Hogan <chogan@hdfgroup.org> | 2019-11-04 21:10:44 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-05-20 14:17:26 (GMT) |
commit | e5b0979bf74ec8afaafae6ff0b7f7233847994e1 (patch) | |
tree | 9f967cea0db4e1e7ab0b132e09e538c39ec1d5e1 /src | |
parent | d596963eb9acc751cf327907219a2f4462a6a710 (diff) | |
download | hdf5-e5b0979bf74ec8afaafae6ff0b7f7233847994e1.zip hdf5-e5b0979bf74ec8afaafae6ff0b7f7233847994e1.tar.gz hdf5-e5b0979bf74ec8afaafae6ff0b7f7233847994e1.tar.bz2 |
Handle H5CX_state_t for lcpl
Diffstat (limited to 'src')
-rw-r--r-- | src/H5CX.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -884,6 +884,18 @@ H5CX_retrieve_state(H5CX_state_t **api_state) else (*api_state)->lapl_id = H5P_LINK_ACCESS_DEFAULT; + /* Check for non-default LCPL */ + if(H5P_LINK_CREATE_DEFAULT != (*head)->ctx.lcpl_id) { + /* Retrieve the LCPL property list */ + H5CX_RETRIEVE_PLIST(lcpl, FAIL) + + /* Copy the LCPL ID */ + if(((*api_state)->lcpl_id = H5P_copy_plist((H5P_genplist_t *)(*head)->ctx.lcpl, FALSE)) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTCOPY, FAIL, "can't copy property list") + } /* end if */ + else + (*api_state)->lcpl_id = H5P_LINK_CREATE_DEFAULT; + /* Keep a reference to the current VOL wrapping context */ (*api_state)->vol_wrap_ctx = (*head)->ctx.vol_wrap_ctx; if(NULL != (*api_state)->vol_wrap_ctx) @@ -964,6 +976,10 @@ H5CX_restore_state(const H5CX_state_t *api_state) (*head)->ctx.lapl_id = api_state->lapl_id; (*head)->ctx.lapl = NULL; + /* Restore the LCPL info */ + (*head)->ctx.lcpl_id = api_state->lcpl_id; + (*head)->ctx.lcpl = NULL; + /* Restore the VOL wrapper context */ (*head)->ctx.vol_wrap_ctx = api_state->vol_wrap_ctx; @@ -1014,6 +1030,11 @@ H5CX_free_state(H5CX_state_t *api_state) if(H5I_dec_ref(api_state->lapl_id) < 0) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTDEC, FAIL, "can't decrement refcount on LAPL") + /* Release the LCPL */ + if(api_state->lcpl_id != H5P_LINK_CREATE_DEFAULT) + if(H5I_dec_ref(api_state->lcpl_id) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTDEC, FAIL, "can't decrement refcount on LCPL") + /* Release the VOL wrapper context */ if(api_state->vol_wrap_ctx) if(H5VL_dec_vol_wrapper(api_state->vol_wrap_ctx) < 0) |