Fix issue in h5dump where reference objects weren't being destroyed

This commit is contained in:
Jordan Henderson 2019-12-31 11:33:27 -06:00
parent 5681bede70
commit 9c9b9b1c7a

View File

@ -4092,8 +4092,6 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
datactx.indent_level--;
if(H5Dclose(new_obj_id) < 0)
H5TOOLS_INFO("H5Dclose H5R_OBJECT1:H5O_TYPE_DATASET failed");
if(H5Rdestroy(&ref_buf[i]) < 0)
H5TOOLS_INFO("H5Rdestroy H5R_OBJECT1:H5O_TYPE_DATASET failed");
}
else
H5TOOLS_INFO("H5Ropen_object H5R_OBJECT1:H5O_TYPE_DATASET failed");
@ -4119,8 +4117,6 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
datactx.indent_level--;
if(H5Dclose(new_obj_id) < 0)
H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION1 failed");
if(H5Rdestroy(&ref_buf[i]) < 0)
H5TOOLS_INFO("H5Rdestroy H5R_DATASET_REGION1 failed");
}
else
H5TOOLS_INFO("H5Ropen_object H5R_DATASET_REGION1 failed");
@ -4139,8 +4135,6 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
datactx.indent_level--;
if(H5Oclose(new_obj_id) < 0)
H5TOOLS_INFO("H5Oclose H5R_OBJECT2 failed");
if(H5Rdestroy(&ref_buf[i]) < 0)
H5TOOLS_INFO("H5Rdestroy H5R_OBJECT2 failed");
}
else
H5TOOLS_INFO("H5Ropen_object H5R_OBJECT2 failed");
@ -4217,8 +4211,6 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
H5TOOLS_INFO("H5Ropen_region H5R_DATASET_REGION2 failed");
if(H5Dclose(new_obj_id) < 0)
H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION2 failed");
if(H5Rdestroy(&ref_buf[i]) < 0)
H5TOOLS_INFO("H5Rdestroy H5R_DATASET_REGION2 failed");
}
break;
case H5R_ATTR:
@ -4228,8 +4220,6 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
&buffer, &curr_pos, ncols, i, elmt_counter);
if(H5Aclose(new_obj_id) < 0)
H5TOOLS_INFO("H5Aclose H5R_ATTR failed");
if(H5Rdestroy(&ref_buf[i]) < 0)
H5TOOLS_INFO("H5Rdestroy H5R_ATTR failed");
}
else {
H5TOOLS_DEBUG("NULL H5R_ATTR");
@ -4263,6 +4253,9 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
break;
} /* end switch */
if(H5Rdestroy(&ref_buf[i]) < 0)
H5TOOLS_INFO("H5Rdestroy failed");
H5TOOLS_DEBUG("finished reference loop:%d",i);
} /* end for(i = 0; i < ndims; i++, datactx->cur_elmt++, elmt_counter++) */
HDfree(ref_buf);