summaryrefslogtreecommitdiffstats
path: root/c++/src/H5PropList.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2005-02-20 20:45:44 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2005-02-20 20:45:44 (GMT)
commit6f2de2c62cdc8a6def14fd06b0b25fae1d487d28 (patch)
tree2f0bef8ee7912db66bb0432a4d9be19c41cfe4ac /c++/src/H5PropList.cpp
parent322297809cfe9e7ca4ed39d62706f1d0301a0da1 (diff)
downloadhdf5-6f2de2c62cdc8a6def14fd06b0b25fae1d487d28.zip
hdf5-6f2de2c62cdc8a6def14fd06b0b25fae1d487d28.tar.gz
hdf5-6f2de2c62cdc8a6def14fd06b0b25fae1d487d28.tar.bz2
[svn-r10050] Purpose: Fix bugzilla #241
Description: Checked return value from C API for failure condition. Added/Modified some comments appropriately. Platforms tested: Linux 2.4 (heping) AIX 5.1 (copper) - tests passed but there were some old warnings about duplicate symbols on std::string; I'll check on that.
Diffstat (limited to 'c++/src/H5PropList.cpp')
-rw-r--r--c++/src/H5PropList.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp
index a9dd22a..8e2c12b 100644
--- a/c++/src/H5PropList.cpp
+++ b/c++/src/H5PropList.cpp
@@ -86,11 +86,14 @@ PropList::PropList( const hid_t plist_id ) : IdComponent(0)
///\param like_plist - IN: Reference to the existing property list
///\exception H5::PropListIException
// Programmer Binh-Minh Ribler - 2000
+// Modification
+// Replaced resetIdComponent with decRefCount to use new ID
+// reference counting mechanisms by Quincey Koziol, June 1, 2004
//--------------------------------------------------------------------------
void PropList::copy( const PropList& like_plist )
{
- // reset the identifier of this PropList - send 'this' in so that
- // H5Pclose can be called appropriately
+ // If this object has a valid id, appropriately decrement reference
+ // counter and close the id.
try {
decRefCount();
}
@@ -324,7 +327,7 @@ size_t PropList::getPropSize(const char *name) const
{
size_t prop_size;
herr_t ret_value = H5Pget_size(id, name, &prop_size);
- if (prop_size < 0)
+ if (ret_value < 0)
{
throw PropListIException("PropList::getPropSize", "H5Pget_size failed");
}
@@ -376,7 +379,7 @@ size_t PropList::getNumProps() const
{
size_t nprops;
herr_t ret_value = H5Pget_nprops (id, &nprops);
- if( nprops < 0 )
+ if (ret_value < 0)
{
throw PropListIException("PropList::getNumProps", "H5Pget_nprops failed");
}