Skip to content

Commit

Permalink
Set/Unset VOL wrapping context in H5VL_attr_close (#4759)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendersonHDF authored Aug 26, 2024
1 parent 6ccbf30 commit e5eede6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/H5VLcallback.c
Original file line number Diff line number Diff line change
Expand Up @@ -1744,18 +1744,28 @@ H5VL__attr_close(void *obj, const H5VL_class_t *cls, hid_t dxpl_id, void **req)
herr_t
H5VL_attr_close(const H5VL_object_t *vol_obj, hid_t dxpl_id, void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */

FUNC_ENTER_NOAPI(FAIL)

/* Sanity check */
assert(vol_obj);

/* Set wrapper info in API context */
if (H5VL_set_vol_wrapper(vol_obj) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info");
vol_wrapper_set = true;

/* Call the corresponding internal VOL routine */
if (H5VL__attr_close(vol_obj->data, vol_obj->connector->cls, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTCLOSEOBJ, FAIL, "attribute close failed");

done:
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info");

FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_attr_close() */

Expand Down

0 comments on commit e5eede6

Please sign in to comment.