summaryrefslogtreecommitdiffstats
path: root/c++/src/H5IdComponent.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2015-10-11 04:05:21 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2015-10-11 04:05:21 (GMT)
commitfc84edb7e3514556e1b5cbd5268d35fcf21054b6 (patch)
tree06d36bc6f55016fc2be2dffe019a7c16f094da7e /c++/src/H5IdComponent.cpp
parentcd49e8a2abcd1a6fd1a4ac578cc208e2bbad1914 (diff)
downloadhdf5-fc84edb7e3514556e1b5cbd5268d35fcf21054b6.zip
hdf5-fc84edb7e3514556e1b5cbd5268d35fcf21054b6.tar.gz
hdf5-fc84edb7e3514556e1b5cbd5268d35fcf21054b6.tar.bz2
[svn-r28027] Purpose: Fix memory leaks
Description: - Removed H5Library::instance because it is unnecessary. All H5Library's methods are static. This, in turn, removed the memory leaks by H5Library::instance not being deleted. - Added ObjCreatPropList::deleteConstants to atexist() list - Cleaned up comments and format inconsistencies with 1.8 Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test)
Diffstat (limited to 'c++/src/H5IdComponent.cpp')
-rw-r--r--c++/src/H5IdComponent.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp
index 93ee4fd..19d68cf 100644
--- a/c++/src/H5IdComponent.cpp
+++ b/c++/src/H5IdComponent.cpp
@@ -26,14 +26,19 @@
namespace H5 {
#endif
-// This flag controls whether H5Library::initH5cpp has been called to register
-// terminating functions with atexit()
+// This flag indicates whether H5Library::initH5cpp has been called to register
+// the terminating functions with atexit()
bool IdComponent::H5cppinit = false;
+
+// This flag is used to decide whether H5dont_atexit should be called.
+// Subclasses that have global constants use it. This is a temporary
+// work-around in 1.8.16. It will be removed after HDFFV-9540 is fixed.
bool IdComponent::H5dontAtexit_called = false;
//--------------------------------------------------------------------------
// Function: IdComponent overloaded constructor
-// Purpose Creates an IdComponent object using the id of an existing object.
+///\brief Creates an IdComponent object using the id of an existing
+/// object. - Obsolete, will be removed in 1.8.17
// Param h5_id - IN: Id of an existing object
// Exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
@@ -43,7 +48,6 @@ bool IdComponent::H5dontAtexit_called = false;
// been moved to the sub-classes. It will be removed in 1.10 release. If its
// removal does not raise any problems in 1.10, it will be removed from 1.8 in
// subsequent releases.
-// - Removed from documentation in 1.8.16 -BMR (October 2015)
//--------------------------------------------------------------------------
IdComponent::IdComponent(const hid_t h5_id) {}
@@ -295,10 +299,10 @@ H5std_string IdComponent::inMemFunc(const char* func_name) const
IdComponent::IdComponent()
{
// initH5cpp will register the terminating functions with atexit().
- // We only do this once.
+ // This should only be done once.
if (!H5cppinit)
{
- H5Library::getInstance()->initH5cpp();
+ H5Library::initH5cpp();
H5cppinit = true;
}
}