diff options
author | tradke <schnetter@cct.lsu.edu> | 2007-10-18 11:57:00 +0000 |
---|---|---|
committer | tradke <schnetter@cct.lsu.edu> | 2007-10-18 11:57:00 +0000 |
commit | 66eff79629268735c6695f7700bd8e8a1eadd2fb (patch) | |
tree | c2d1f20a20395694d0ec9ebee9dc655a6dda3305 /Carpet | |
parent | 3215a191496ef0f9807d3b574151e91ebc27ca8a (diff) |
CarpetIOHDF5: fix memory leak in recovery code
The new code to collect I/O timing statistics introduced a memory leak
while accumulating the number of bytes transfered.
darcs-hash:20071018115734-3fd61-e087a4ad1c8fdcf8a59320b71f90b92e9fd850de.gz
Diffstat (limited to 'Carpet')
-rw-r--r-- | Carpet/CarpetIOHDF5/src/Input.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Carpet/CarpetIOHDF5/src/Input.cc b/Carpet/CarpetIOHDF5/src/Input.cc index 58b493c9a..7e046b914 100644 --- a/Carpet/CarpetIOHDF5/src/Input.cc +++ b/Carpet/CarpetIOHDF5/src/Input.cc @@ -1024,9 +1024,10 @@ static int ReadVar (const cGH* const cctkGH, NULL, count, NULL)); HDF5_ERROR (H5Dread (dataset, datatype, memspace, filespace, H5P_DEFAULT, cctkGH->data[patch->vindex][timelevel])); - io_bytes += - H5Sget_simple_extent_npoints (filespace) * - H5Tget_size (H5Dget_type (dataset)); + hid_t datatype; + HDF5_ERROR (datatype = H5Dget_type (dataset)); + io_bytes += H5Sget_select_npoints (filespace) * H5Tget_size (datatype); + HDF5_ERROR (H5Tclose (datatype)); HDF5_ERROR (H5Sclose (memspace)); } END_LOCAL_COMPONENT_LOOP; |