diff options
Diffstat (limited to 'src/H5Goh.c')
-rw-r--r-- | src/H5Goh.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/H5Goh.c b/src/H5Goh.c index 4f7dbc6..3ccdf16 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -260,6 +260,7 @@ herr_t H5O_group_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) { H5O_linfo_t linfo; /* Link info message */ + H5HF_t *fheap = NULL; /* Fractal heap handle */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5O_group_bh_info, FAIL) @@ -296,12 +297,27 @@ H5O_group_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info") /* Get fractal heap size, if available */ - if(H5F_addr_defined(linfo.fheap_addr)) - if(H5HF_size(f, dxpl_id, linfo.fheap_addr, &bh_info->heap_size) < 0) + if(H5F_addr_defined(linfo.fheap_addr)) { + /* Open the fractal heap for links */ + if(NULL == (fheap = H5HF_open(f, dxpl_id, linfo.fheap_addr))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") + + /* Get heap storage size */ + if(H5HF_size(fheap, dxpl_id, &bh_info->heap_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve fractal heap storage info") + + /* Release the fractal heap */ + if(H5HF_close(fheap, dxpl_id) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CLOSEERROR, FAIL, "can't close fractal heap") + fheap = NULL; + } /* end if */ } /* end else */ done: + /* Release resources */ + if(fheap && H5HF_close(fheap, dxpl_id) < 0) + HDONE_ERROR(H5E_HEAP, H5E_CLOSEERROR, FAIL, "can't close fractal heap") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_group_bh_info() */ |