summaryrefslogtreecommitdiffstats
path: root/c++/src/H5IdComponent.h
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2015-10-11 04:44:03 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2015-10-11 04:44:03 (GMT)
commitd0b7e864be07f9e293b9e8719c07b73a0d92ff64 (patch)
tree62c8fc1292a437f22e7d512894322b397dcbc75c /c++/src/H5IdComponent.h
parent62f73dfa865207f7b0336b08578cb273be3ce691 (diff)
downloadhdf5-d0b7e864be07f9e293b9e8719c07b73a0d92ff64.zip
hdf5-d0b7e864be07f9e293b9e8719c07b73a0d92ff64.tar.gz
hdf5-d0b7e864be07f9e293b9e8719c07b73a0d92ff64.tar.bz2
[svn-r28030] Purpose: Fix memory leaks
Description: Merged from trunk r28027. - 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.h')
-rw-r--r--c++/src/H5IdComponent.h32
1 files changed, 17 insertions, 15 deletions
diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h
index 4b72cdf..34f2da8 100644
--- a/c++/src/H5IdComponent.h
+++ b/c++/src/H5IdComponent.h
@@ -32,12 +32,7 @@ class DataSpace;
rarely needs them.
*/
class H5_DLLCPP IdComponent {
- public:
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
- static bool H5cppinit;
- static bool H5dontAtexit_called;
-#endif // DOXYGEN_SHOULD_SKIP_THIS
+ public:
// Increment reference counter.
void incRefCount(const hid_t obj_id) const;
@@ -60,11 +55,6 @@ class H5_DLLCPP IdComponent {
// Assignment operator.
IdComponent& operator=( const IdComponent& rhs );
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
- // Gets the identifier of this object.
- virtual hid_t getId () const = 0;
-#endif // DOXYGEN_SHOULD_SKIP_THIS
-
// Sets the identifier of this object to a new value.
void setId(const hid_t new_id);
@@ -78,10 +68,14 @@ class H5_DLLCPP IdComponent {
// Creates an object to hold an HDF5 identifier.
IdComponent( const hid_t h5_id );
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+
// Copy constructor: makes copy of the original IdComponent object.
- // IdComponent( const IdComponent& original );
+ // IdComponent( const IdComponent& original ); - removed from 1.8.15
+
+ // Gets the identifier of this object.
+ virtual hid_t getId () const = 0;
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
// Pure virtual function for there are various H5*close for the
// subclasses.
virtual void close() = 0;
@@ -99,7 +93,8 @@ class H5_DLLCPP IdComponent {
virtual ~IdComponent();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
- protected:
+
+ protected:
// Default constructor.
IdComponent();
@@ -113,7 +108,14 @@ class H5_DLLCPP IdComponent {
// Sets the identifier of this object to a new value. - this one
// doesn't increment reference count
virtual void p_setId(const hid_t new_id) = 0;
- //virtual void p_setId(const hid_t new_id);
+
+ // This flag is used to decide whether H5dont_atexit should be called
+ static bool H5dontAtexit_called;
+
+ private:
+ // This flag indicates whether H5Library::initH5cpp has been called
+ // to register various terminating functions with atexit()
+ static bool H5cppinit;
#endif // DOXYGEN_SHOULD_SKIP_THIS