diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2012-04-02 03:14:19 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2012-04-02 03:14:19 (GMT) |
commit | 88ce565d7d324569f2a360aa37bfeefffa021a8a (patch) | |
tree | 94e9dc7c38bb49e7c70c42f6c3fcca73eacfd545 /c++/src/H5PredType.cpp | |
parent | 42306f8ed4ade51a8629b9c5a159d1afac5f617f (diff) | |
download | hdf5-88ce565d7d324569f2a360aa37bfeefffa021a8a.zip hdf5-88ce565d7d324569f2a360aa37bfeefffa021a8a.tar.gz hdf5-88ce565d7d324569f2a360aa37bfeefffa021a8a.tar.bz2 |
[svn-r22235] Purpose: Fixed bugs HDFFV-2761 & HDFFV-7852
Description:
- Replaced PredType::NotAtexit() with PredType::AtExit(H5CPP_EXITED);
and used PredType::AtExit as a flag to detect when all predefined
types have been destroyed. Then, H5close will be called to terminate
the library after its being re-initiated when the PredType destructors
were activated. This change removed the memory leaks shown by the
user's sample program.
- Added H5CPP_EXITED for PredType::AtExit to use as a flag
- Updated some inaccurate comments
- Removed stream functions from FileAccPropList
- Replaced H5_VMS with appropriate macro in H5IdComponent.cpp
- Corrected many URLs (hdfgroup vs. ncsa) in comments
- Replaced std::string with H5std_string in comments
Platforms tested:
Linux/32 2.6 (jam)
Linux/64 2.6 (amani)
SunOS 5.10 (linew)
Diffstat (limited to 'c++/src/H5PredType.cpp')
-rw-r--r-- | c++/src/H5PredType.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index 347f02f..9dfc760 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -44,7 +44,10 @@ namespace H5 { //-------------------------------------------------------------------------- PredType::PredType( const hid_t predtype_id ) : AtomType( predtype_id ) { - id = H5Tcopy(predtype_id); + if (predtype_id == H5CPP_EXITED) + id = predtype_id; + else + id = H5Tcopy(predtype_id); } //-------------------------------------------------------------------------- @@ -62,7 +65,8 @@ PredType::PredType() : AtomType() {} //-------------------------------------------------------------------------- PredType::PredType( const PredType& original ) : AtomType( original ) {} -const PredType PredType::NotAtexit; // only for atexit/global dest. problem +// Flag to terminate HDF5 library in DataType::~DataType +const PredType PredType::AtExit(H5CPP_EXITED); // Definition of pre-defined types const PredType PredType::C_S1( H5T_C_S1 ); |