Skip to content

If I call h5gopen, and it fails, do i still need to call h5gclose after to release memory?? #3627

Closed Answered by jhendersonHDF
jjepson2 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @jjepson2,

For any object (file, group, dataset, attribute, etc.) that you attempt to open,
if the H5Xopen (H5Fopen, H5Dopen, etc.) call fails, then you do NOT need to
call H5Xclose to release any potential memory allocations; the library should
do this and return H5I_INVALID_HID from the H5Xopen call. Attempting to call
H5Xclose on that returned ID value will cause an error from HDF5.

However, if you find that memory is still allocated after an H5Xopen call fails,
please let us know so that we can investigate.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jjepson2
Comment options

Answer selected by jjepson2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants