From e5eede68429e22849691f545db78b83664be3703 Mon Sep 17 00:00:00 2001 From: jhendersonHDF Date: Mon, 26 Aug 2024 12:38:31 -0500 Subject: [PATCH] Set/Unset VOL wrapping context in H5VL_attr_close (#4759) --- src/H5VLcallback.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/H5VLcallback.c b/src/H5VLcallback.c index 1662776ef9c..58e839c9985 100644 --- a/src/H5VLcallback.c +++ b/src/H5VLcallback.c @@ -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() */