summaryrefslogtreecommitdiffstats
path: root/c++/src/H5PropList.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2000-12-23 13:17:32 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2000-12-23 13:17:32 (GMT)
commitd24bacb8a47f945e6919f067e8057ad30012bd5a (patch)
tree2844b08018435b9d33f68ef4b787d5434db66d5a /c++/src/H5PropList.cpp
parent45c5dd949f7dd4549dc5996ff8395652ef3d9dda (diff)
downloadhdf5-d24bacb8a47f945e6919f067e8057ad30012bd5a.zip
hdf5-d24bacb8a47f945e6919f067e8057ad30012bd5a.tar.gz
hdf5-d24bacb8a47f945e6919f067e8057ad30012bd5a.tar.bz2
[svn-r3199]
Purpose: bug fix Description: I found a couple of places where virtual destructors were missing and could cause small memory leaks. Also, some destructors were not virtual when they should be. Solution: - added virtual destructors, which also free dynamically allocated memory - added virtual to several destructors - also, fixed several typos Platforms tested: Solaris 2.7 (arabica)
Diffstat (limited to 'c++/src/H5PropList.cpp')
-rw-r--r--c++/src/H5PropList.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp
index 5279be0..ad9c8ca 100644
--- a/c++/src/H5PropList.cpp
+++ b/c++/src/H5PropList.cpp
@@ -15,10 +15,7 @@ const PropList PropList::DEFAULT( H5P_DEFAULT );
// Default constructor - set id to 0 by default here but may be set
// to a valid one, if any, by a subclass constructor.
-PropList::PropList() : IdComponent( 0 )
-{
-// id_obj = new IdComponent( 0 ); // init default object's id to 0
-}
+PropList::PropList() : IdComponent( 0 ) {}
// Creates a new property of specified type
PropList::PropList( H5P_class_t type ) : IdComponent( 0 )
@@ -55,10 +52,7 @@ void PropList::copy( const PropList& like_plist )
id = H5Pcopy( like_plist.getId() );
// points to the same ref counter
- ref_count = like_plist.ref_count;
-
- // increment ref counter to indicate additional references to this id
- ref_count->increment();
+ ref_count = new RefCounter;
if( id <= 0 )
{