summaryrefslogtreecommitdiffstats
path: root/src/H5Dint.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-04-02 06:27:08 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2020-04-02 06:27:08 (GMT)
commit3cd1b46b9cdcc28507cc13441134bb6d58e41086 (patch)
tree04ec0cb43ac1bf4838c943f75728869d0a7ab356 /src/H5Dint.c
parent816a12f04f5853a8d295791dab98eebec057452b (diff)
parentbae05235a2d87acb0d6b3a2e1c32f3b6f48cf203 (diff)
downloadhdf5-3cd1b46b9cdcc28507cc13441134bb6d58e41086.zip
hdf5-3cd1b46b9cdcc28507cc13441134bb6d58e41086.tar.gz
hdf5-3cd1b46b9cdcc28507cc13441134bb6d58e41086.tar.bz2
Merge branch 'develop' into tools_vol_update
Diffstat (limited to 'src/H5Dint.c')
-rw-r--r--src/H5Dint.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/H5Dint.c b/src/H5Dint.c
index 3e625de..954b619 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -207,6 +207,9 @@ H5D__init_package(void)
/* Reset the "default dataset" information */
HDmemset(&H5D_def_dset, 0, sizeof(H5D_shared_t));
+ H5D_def_dset.type_id = H5I_INVALID_HID;
+ H5D_def_dset.dapl_id = H5I_INVALID_HID;
+ H5D_def_dset.dcpl_id = H5I_INVALID_HID;
/* Get the default dataset creation property list values and initialize the
* default dataset with them.
@@ -1418,8 +1421,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")