Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set/Unset VOL wrapping context in H5VL_attr_close #4759

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading