mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-30 16:10:44 +08:00
only close non-zero typeids
This commit is contained in:
parent
af6b6787bf
commit
b7ac19a43f
@ -585,9 +585,11 @@ close_vars(NC_GRP_INFO_T *grp)
|
||||
/* Free the HDF5 typeids. */
|
||||
if (var->type_info->rc == 1)
|
||||
{
|
||||
if (H5Tclose(((NC_HDF5_TYPE_INFO_T *)(var->type_info->format_type_info))->hdf_typeid) < 0)
|
||||
if (((NC_HDF5_TYPE_INFO_T *)(var->type_info->format_type_info))->hdf_typeid &&
|
||||
H5Tclose(((NC_HDF5_TYPE_INFO_T *)(var->type_info->format_type_info))->hdf_typeid) < 0)
|
||||
return NC_EHDFERR;
|
||||
if (H5Tclose(((NC_HDF5_TYPE_INFO_T *)(var->type_info->format_type_info))->native_hdf_typeid) < 0)
|
||||
if (((NC_HDF5_TYPE_INFO_T *)(var->type_info->format_type_info))->native_hdf_typeid &&
|
||||
H5Tclose(((NC_HDF5_TYPE_INFO_T *)(var->type_info->format_type_info))->native_hdf_typeid) < 0)
|
||||
return NC_EHDFERR;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user