From 2eeda063bab4f82fef348383e5ef03023390a306 Mon Sep 17 00:00:00 2001 From: Chris Hogan Date: Mon, 4 Nov 2019 15:10:44 -0600 Subject: Handle H5CX_state_t for lcpl --- src/H5CX.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/H5CX.c b/src/H5CX.c index b7e1e1b..2b17488 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -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) -- cgit v0.12