summaryrefslogtreecommitdiffstats
path: root/c++/src/H5Exception.h
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.h
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.h')
-rw-r--r--c++/src/H5Exception.h43
1 files changed, 16 insertions, 27 deletions
diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h
index 69ecf42..c8e4132 100644
--- a/c++/src/H5Exception.h
+++ b/c++/src/H5Exception.h
@@ -59,95 +59,83 @@ class Exception {
// Prints the error stack in a default manner.
//void printError() const;
- void printError( FILE* stream = NULL ) const;
+ virtual void printError( FILE* stream = NULL ) const;
+
+ // virtual Destructor
+ virtual ~Exception();
private:
string detailMessage;
};
-// This exception is privately used in Group and H5File only
-class File_GroupException {
- public:
- File_GroupException();
- File_GroupException( string message );
-};
-
class FileIException : public Exception {
public:
FileIException();
FileIException( string message );
+ virtual ~FileIException();
};
class GroupIException : public Exception {
public:
GroupIException();
GroupIException( string message );
-};
-
-class ObjectHeaderException : public Exception {
- public:
- ObjectHeaderException();
- ObjectHeaderException( string message );
+ virtual ~GroupIException();
};
class DataSpaceIException : public Exception {
public:
DataSpaceIException();
DataSpaceIException( string message );
+ virtual ~DataSpaceIException();
};
class DataTypeIException : public Exception {
public:
DataTypeIException();
DataTypeIException( string message );
+ virtual ~DataTypeIException();
};
class PropListIException : public Exception {
public:
PropListIException();
PropListIException( string message );
+ virtual ~PropListIException();
};
class DataSetIException : public Exception {
public:
DataSetIException();
DataSetIException( string message );
+ virtual ~DataSetIException();
};
class AttributeIException : public Exception {
public:
AttributeIException();
AttributeIException( string message );
-};
-
-class FunctionArgumentException : public Exception {
- public:
- FunctionArgumentException();
- FunctionArgumentException( string message );
+ virtual ~AttributeIException();
};
class ReferenceException : public Exception {
public:
ReferenceException();
ReferenceException( string message );
-};
-
-class DataStorageException : public Exception {
- public:
- DataStorageException();
- DataStorageException( string message );
+ virtual ~ReferenceException();
};
class LibraryIException : public Exception {
public:
LibraryIException();
LibraryIException( string message );
+ virtual ~LibraryIException();
};
class IdComponentException : public Exception {
public:
IdComponentException();
IdComponentException( string message );
+ virtual ~IdComponentException();
};
// The following are from Java API but not done here:
@@ -155,7 +143,8 @@ class IdComponentException : public Exception {
// ExternalFilelistException, FunctionEntryExitException,
// HeapException, InternalErrorException, LowLevelIOException,
// MetaDataCacheException, ResourceUnavailableException,
-// SymbolTableException
+// SymbolTableException, ObjectHeaderException, FunctionArgumentException,
+// DataStorageException
#ifndef H5_NO_NAMESPACE
}
#endif