diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2008-07-24 21:18:28 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2008-07-24 21:18:28 (GMT) |
commit | 836f7b53ccce4f67c1918b337c1a133191c58a98 (patch) | |
tree | 1fb98f124ac675a2a3e3a1ab62e6266d1a7f9900 /c++/src/H5File.cpp | |
parent | e1ee78dd0997e240247353fe1f363cd3ef0e4987 (diff) | |
download | hdf5-836f7b53ccce4f67c1918b337c1a133191c58a98.zip hdf5-836f7b53ccce4f67c1918b337c1a133191c58a98.tar.gz hdf5-836f7b53ccce4f67c1918b337c1a133191c58a98.tar.bz2 |
[svn-r15401] Purpose: Fix bug
Description:
Changed all subclasses' setId to p_setId and put back setId in
IdComponent. p_setId is used in the library where the id provided
by a C API passed on to user's application in the form of a C++ API
object, which will be destroyed properly, and so p_setId does not
call incRefCount. On the other hand, the public version setId is
used by other applications, in which the id passed to setId needs
to be closed properly by the application, so setId must call incRefCount
for the new object to prevent prematurely closing of the id.
Platforms tested:
Linux 2.6 (kagiso)
Still on going with these two platforms, but needed to check in before
daily tests start.
SunOS 5.10 (linew)
FreeBSD (duty)
Diffstat (limited to 'c++/src/H5File.cpp')
-rw-r--r-- | c++/src/H5File.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 7cd1936..0e71543 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -732,7 +732,7 @@ hid_t H5File::getId() const } //-------------------------------------------------------------------------- -// Function: H5File::setId +// Function: H5File::p_setId ///\brief Sets the identifier of this object to a new value. /// ///\exception H5::IdComponentException when the attempt to close the HDF5 @@ -743,14 +743,14 @@ hid_t H5File::getId() const // Then the object's id is reset to the new id. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5File::setId(const hid_t new_id) +void H5File::p_setId(const hid_t new_id) { // handling references to this old id try { close(); } catch (Exception E) { - throw FileIException("H5File::setId", E.getDetailMsg()); + throw FileIException("H5File::p_setId", E.getDetailMsg()); } // reset object's id to the given id id = new_id; |