aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetIOHDF5/src/Output.cc
diff options
context:
space:
mode:
authorThomas Radke <tradke@aei.mpg.de>2006-02-12 14:30:00 +0000
committerThomas Radke <tradke@aei.mpg.de>2006-02-12 14:30:00 +0000
commit6aa1577bbab3a9f02bd45b91980d58f5640406b1 (patch)
tree851091f7452fa1bffd00261a9bb7c23d0c0eb553 /Carpet/CarpetIOHDF5/src/Output.cc
parentbe5e2d4b7498b80c175fe283a2361af2bd4ab006 (diff)
CarpetIOHDF5: fix small memory leak in HDF5 output
While outputting dataset attributes, an HDF5 dataspace wasn't closed properly. darcs-hash:20060212143008-776a0-41e46c61bce2dc22fbfc7093d2ad776bfae00687.gz
Diffstat (limited to 'Carpet/CarpetIOHDF5/src/Output.cc')
-rw-r--r--Carpet/CarpetIOHDF5/src/Output.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/Carpet/CarpetIOHDF5/src/Output.cc b/Carpet/CarpetIOHDF5/src/Output.cc
index 0756eb757..3562f2a4e 100644
--- a/Carpet/CarpetIOHDF5/src/Output.cc
+++ b/Carpet/CarpetIOHDF5/src/Output.cc
@@ -578,6 +578,7 @@ static int AddAttributes (const cGH *const cctkGH, const char *fullname,
dataspace, H5P_DEFAULT));
HDF5_ERROR (H5Awrite (attr, datatype, fullname));
HDF5_ERROR (H5Aclose (attr));
+ HDF5_ERROR (H5Tclose (datatype));
HDF5_ERROR (H5Sclose (dataspace));
// store cctk_bbox and cctk_nghostzones (for grid arrays only)
@@ -601,6 +602,7 @@ static int AddAttributes (const cGH *const cctkGH, const char *fullname,
dataspace, H5P_DEFAULT));
HDF5_ERROR (H5Awrite (attr, H5T_NATIVE_INT, &cctk_nghostzones[0]));
HDF5_ERROR (H5Aclose (attr));
+ HDF5_ERROR (H5Sclose (dataspace));
}
// write bbox attributes if we have coordinate system info
@@ -644,7 +646,6 @@ static int AddAttributes (const cGH *const cctkGH, const char *fullname,
HDF5_ERROR (H5Awrite (attr, H5T_NATIVE_INT, &iorigin[0]));
HDF5_ERROR (H5Aclose (attr));
- HDF5_ERROR (H5Tclose (datatype));
HDF5_ERROR (H5Sclose (dataspace));
// return the number of errors that occured during this output