summaryrefslogtreecommitdiffstats
path: root/c++
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2018-03-15 14:06:16 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2018-03-15 14:06:16 (GMT)
commit8f5be458f4284f763ef30c5bf665740d69c5ec16 (patch)
treee6a6a8c2e2e74215ee92202266f3d23bb1970231 /c++
parent19d54162ce7e43f04572b7cea12695df11ba7bea (diff)
downloadhdf5-8f5be458f4284f763ef30c5bf665740d69c5ec16.zip
hdf5-8f5be458f4284f763ef30c5bf665740d69c5ec16.tar.gz
hdf5-8f5be458f4284f763ef30c5bf665740d69c5ec16.tar.bz2
Fixed memory leak
Description: Added LinkCreatPropList to initH5cpp to cleaning up resource at exit. Platforms tested: Linux/64 (jelly) Linux/ppc64 (ostrich)
Diffstat (limited to 'c++')
-rw-r--r--c++/src/H5Library.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp
index 55f82f5..2cbdfba 100644
--- a/c++/src/H5Library.cpp
+++ b/c++/src/H5Library.cpp
@@ -188,6 +188,10 @@ void H5Library::initH5cpp()
if (ret_value != 0)
throw LibraryIException("H5Library::initH5cpp", "Registrating LinkAccPropList::deleteConstants failed");
+ ret_value = std::atexit(LinkCreatPropList::deleteConstants);
+ if (ret_value != 0)
+ throw LibraryIException("H5Library::initH5cpp", "Registrating LinkCreatPropList::deleteConstants failed");
+
ret_value = std::atexit(FileAccPropList::deleteConstants);
if (ret_value != 0)
throw LibraryIException("H5Library::initH5cpp", "Registrating FileAccPropList::deleteConstants failed");