summaryrefslogtreecommitdiffstats
path: root/c++/src/H5Exception.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/H5Exception.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/H5Exception.cpp')
-rw-r--r--c++/src/H5Exception.cpp53
1 files changed, 23 insertions, 30 deletions
diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp
index ea4cb63..4eff181 100644
--- a/c++/src/H5Exception.cpp
+++ b/c++/src/H5Exception.cpp
@@ -128,67 +128,60 @@ void Exception::printError( FILE* stream ) const
throw Exception( "printError: H5Eprint fails" );
}
+Exception::~Exception()
+{
+ herr_t ret_value = H5Eprint( NULL ); // print to stderr
+ if( ret_value < 0 )
+ throw Exception( "printError: H5Eprint fails" );
+}
+
FileIException::FileIException():Exception(){}
-FileIException::FileIException( string message ):
-Exception( message ){}
+FileIException::FileIException( string message ): Exception( message ){}
+FileIException::~FileIException() {}
GroupIException::GroupIException():Exception(){}
-GroupIException::GroupIException( string message ):
-Exception( message ){}
-
-ObjectHeaderException::ObjectHeaderException():Exception(){}
-ObjectHeaderException::ObjectHeaderException( string message ): Exception( message ) {}
+GroupIException::GroupIException( string message ): Exception( message ){}
+GroupIException::~GroupIException() {}
DataSpaceIException::DataSpaceIException():Exception(){}
DataSpaceIException::DataSpaceIException( string message ): Exception( message ) {}
+DataSpaceIException::~DataSpaceIException() {}
DataTypeIException::DataTypeIException():Exception(){}
DataTypeIException::DataTypeIException( string message ): Exception( message ) {}
+DataTypeIException::~DataTypeIException() {}
PropListIException::PropListIException():Exception(){}
PropListIException::PropListIException( string message ): Exception( message ) {}
+PropListIException::~PropListIException() {}
DataSetIException::DataSetIException():Exception(){}
DataSetIException::DataSetIException( string message ): Exception( message ) {}
+DataSetIException::~DataSetIException() {}
AttributeIException::AttributeIException():Exception(){}
AttributeIException::AttributeIException( string message ): Exception( message ) {}
-
-FunctionArgumentException::FunctionArgumentException():Exception(){}
-FunctionArgumentException::FunctionArgumentException( string message ): Exception( message ) {}
+AttributeIException::~AttributeIException() {}
ReferenceException::ReferenceException():Exception(){}
-ReferenceException::ReferenceException( string message ):
-Exception( message ) {}
-
-DataStorageException::DataStorageException():Exception(){}
-DataStorageException::DataStorageException( string message ):
-Exception( message ) {}
+ReferenceException::ReferenceException( string message ): Exception( message ) {}
+ReferenceException::~ReferenceException() {}
LibraryIException::LibraryIException():Exception(){}
-LibraryIException::LibraryIException( string message ):
-Exception( message ) {}
+LibraryIException::LibraryIException( string message ): Exception( message ) {}
+LibraryIException::~LibraryIException() {}
IdComponentException::IdComponentException(): Exception() {}
IdComponentException::IdComponentException( string message ): Exception( message ) {}
+IdComponentException::~IdComponentException() {}
// The following are from Java API but not done here:
// AtomException, BtreeException, DataFiltersException,
// ExternalFileListException, FunctionEntryExitException,
// HeapException, InternalErrorException, LowLevelIOException,
// MetaDataCacheException, ResourceUnavailableException,
-// SymbolTableException
-
-File_GroupException::File_GroupException()
-{
- // for now, do nothing
-}
-
-File_GroupException::File_GroupException( string message )
-{
- // for now, do nothing
-}
-
+// SymbolTableException, ObjectHeaderException, FunctionArgumentException,
+// DataStorageException
#ifndef H5_NO_NAMESPACE
} // end namespace