diff options
Diffstat (limited to 'c++/src/H5PropList.cpp')
-rw-r--r-- | c++/src/H5PropList.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index a65c300..085dfd1 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -245,9 +245,6 @@ void PropList::setId(const hid_t new_id) } // reset object's id to the given id id = new_id; - - // increment the reference counter of the new id - incRefCount(); } //-------------------------------------------------------------------------- @@ -266,8 +263,10 @@ void PropList::close() { throw PropListIException(inMemFunc("close"), "H5Pclose failed"); } - // reset the id because the property list that it represents is now closed - id = 0; + // reset the id when the property list that it represents is no longer + // referenced + if (getCounter() == 0) + id = 0; } } |