summaryrefslogtreecommitdiffstats
path: root/src/H5P.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-12-11 18:25:13 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-12-11 18:25:13 (GMT)
commit69d2e3fd11e6b6530aa4044eae17ce8293b560fd (patch)
treed4a5663b88f2b1b2a699dd5e572e21ffef868e1c /src/H5P.c
parentb9f349d953e46c8e7cf3bd28b992b3cfab92d9d1 (diff)
downloadhdf5-69d2e3fd11e6b6530aa4044eae17ce8293b560fd.zip
hdf5-69d2e3fd11e6b6530aa4044eae17ce8293b560fd.tar.gz
hdf5-69d2e3fd11e6b6530aa4044eae17ce8293b560fd.tar.bz2
[svn-r7931] Purpose:
Bug fix/code cleanup Description: Make H5Pclose_class() decrement the ID's reference count to close a generic property class ID, which allows the new H5I routines to work correctly. Platforms tested: FreeBSD 4.9 (sleipnir) h5committest
Diffstat (limited to 'src/H5P.c')
-rw-r--r--src/H5P.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/H5P.c b/src/H5P.c
index c43b368..052ca11 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -5168,7 +5168,6 @@ done:
herr_t
H5Pclose(hid_t plist_id)
{
- H5P_genplist_t *plist; /* Property list created */
herr_t ret_value=SUCCEED; /* return value */
FUNC_ENTER_API(H5Pclose, FAIL);
@@ -5178,17 +5177,13 @@ H5Pclose(hid_t plist_id)
HGOTO_DONE(SUCCEED);
/* Check arguments. */
- if (NULL == (plist = H5I_object_verify(plist_id, H5I_GENPROP_LST)))
+ if (H5I_GENPROP_LST != H5I_get_type(plist_id))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list");
/* Close the property list */
- if (H5P_close(plist) < 0)
+ if (H5I_dec_ref(plist_id) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "can't close");
- /* Remove the property list from the ID manager now */
- if (NULL == H5I_remove(plist_id))
- HGOTO_ERROR(H5E_ARGS, H5E_CANTDELETE, FAIL, "can't delete property list");
-
done:
FUNC_LEAVE_API(ret_value);
} /* H5Pclose() */
@@ -5562,18 +5557,17 @@ done:
herr_t
H5Pclose_class(hid_t cls_id)
{
- H5P_genclass_t *pclass; /* Property list class created */
hid_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(H5Pclose_class, FAIL);
H5TRACE1("e","i",cls_id);
/* Check arguments */
- if (H5I_GENPROP_CLS != H5I_get_type(cls_id) || NULL == (pclass = H5I_remove(cls_id)))
+ if (H5I_GENPROP_CLS != H5I_get_type(cls_id))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class");
- /* Delete the property list class */
- if (H5P_close_class(pclass) < 0)
+ /* Close the property list class */
+ if (H5I_dec_ref(cls_id) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "can't close");
done: