summaryrefslogtreecommitdiffstats
path: root/c++/src/H5Group.cpp
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2008-07-22 20:36:31 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2008-07-22 20:36:31 (GMT)
commit8704820d1c56165fcf930ab21adebea0a48c664f (patch)
treeb74991b3c84c1a6d52e1003c7668863b1fd3dfb4 /c++/src/H5Group.cpp
parent717388ea0683ff9db970cd8f8998ba9b94d62cf0 (diff)
downloadhdf5-8704820d1c56165fcf930ab21adebea0a48c664f.zip
hdf5-8704820d1c56165fcf930ab21adebea0a48c664f.tar.gz
hdf5-8704820d1c56165fcf930ab21adebea0a48c664f.tar.bz2
[svn-r15395] When an attribute was opened twice and data was written with one of the handles,
the file didn't have the data. It happened because each handle had its own object structure, and the empty one overwrote the data with fill value. This is fixed by making some attribute information like the data be shared in the attribute structure. Tested on smirom, kagiso, and linew.
Diffstat (limited to 'c++/src/H5Group.cpp')
-rw-r--r--c++/src/H5Group.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp
index 7ab3b61..6014466 100644
--- a/c++/src/H5Group.cpp
+++ b/c++/src/H5Group.cpp
@@ -192,9 +192,6 @@ void Group::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();
}
//--------------------------------------------------------------------------
@@ -206,8 +203,6 @@ void Group::setId(const hid_t new_id)
//--------------------------------------------------------------------------
void Group::close()
{
- /* cerr << "Group::close/p_valid_id" << endl;
- */
if (p_valid_id(id))
{
herr_t ret_value = H5Gclose( id );
@@ -215,8 +210,10 @@ void Group::close()
{
throw GroupIException("Group::close", "H5Gclose failed");
}
- // reset the id because the group that it represents is now closed
- id = 0;
+ // reset the id when the group that it represents is no longer
+ // referenced
+ if (getCounter() == 0)
+ id = 0;
}
}