[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.
This commit is contained in:
Raymond Lu
2008-07-22 15:36:31 -05:00
parent 717388ea06
commit 8704820d1c
26 changed files with 1545 additions and 579 deletions

View File

@@ -754,9 +754,6 @@ void H5File::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();
}
//--------------------------------------------------------------------------
@@ -775,8 +772,10 @@ void H5File::close()
{
throw FileIException("H5File::close", "H5Fclose failed");
}
// reset the id because the file that it represents is now closed
id = 0;
// reset the id when the file that it represents is no longer
// referenced
if (getCounter() == 0)
id = 0;
}
}
@@ -813,18 +812,10 @@ void H5File::throwException(const H5std_string& func_name, const H5std_string& m
//--------------------------------------------------------------------------
H5File::~H5File()
{
int counter = getCounter(id);
if (counter > 1)
{
decRefCount(id);
}
else if (counter == 1)
{
try {
close();
} catch (Exception close_error) {
cerr << "H5File::~H5File - " << close_error.getDetailMsg() << endl;
}
try {
close();
} catch (Exception close_error) {
cerr << "H5File::~H5File - " << close_error.getDetailMsg() << endl;
}
}