diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-04-05 16:06:28 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-04-05 16:06:28 (GMT) |
commit | d2b7bacea1d18526f1a21b344b07e1a8305f6bd6 (patch) | |
tree | 111c7cec4e555d8895d55115acf8ff132541e355 /src | |
parent | 965c024c6e02f31454d4282ae606f09bb0b19068 (diff) | |
parent | db3f89ce9dc7eae17cb15d39e402112c3fbd2955 (diff) | |
download | hdf5-d2b7bacea1d18526f1a21b344b07e1a8305f6bd6.zip hdf5-d2b7bacea1d18526f1a21b344b07e1a8305f6bd6.tar.gz hdf5-d2b7bacea1d18526f1a21b344b07e1a8305f6bd6.tar.bz2 |
Merging in latest from upstream (HDFFV/hdf5:refs/heads/hdf5_1_12)
* commit 'db3f89ce9dc7eae17cb15d39e402112c3fbd2955':
Merge pull request #2461 in HDFFV/hdf5 from ~VCHOI/my_third_fork:bugfix/dtype_close_on_error to develop
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Dint.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/H5Dint.c b/src/H5Dint.c index 1624f7b..173ae3f 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -1418,8 +1418,18 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, NULL, "unable to reset external file list info") if(new_dset->shared->space && H5S_close(new_dset->shared->space) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release dataspace") - if(new_dset->shared->type && H5I_dec_ref(new_dset->shared->type_id) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype") + + if(new_dset->shared->type) { + if(new_dset->shared->type_id > 0) { + if(H5I_dec_ref(new_dset->shared->type_id) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype") + } /* end if */ + else { + if(H5T_close_real(new_dset->shared->type) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype") + } /* end else */ + } /* end if */ + if(H5F_addr_defined(new_dset->oloc.addr)) { if(H5O_dec_rc_by_loc(&(new_dset->oloc)) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement refcount on newly created object") |