From f38765a98c778f81f436f6e066bf2e2c9fe0cc72 Mon Sep 17 00:00:00 2001 From: schnetter <> Date: Wed, 3 Mar 2004 12:07:00 +0000 Subject: Close data types, data spaces, and attributes when they are not needed Close data types, data spaces, and attributes when they are not needed any more. darcs-hash:20040303120701-07bb3-bc92d93953009d8e0c22abbde6c188f7ae21e620.gz --- Carpet/CarpetIOHDF5/src/iohdf5.cc | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'Carpet/CarpetIOHDF5/src/iohdf5.cc') diff --git a/Carpet/CarpetIOHDF5/src/iohdf5.cc b/Carpet/CarpetIOHDF5/src/iohdf5.cc index 500e9a0df..70429b1df 100644 --- a/Carpet/CarpetIOHDF5/src/iohdf5.cc +++ b/Carpet/CarpetIOHDF5/src/iohdf5.cc @@ -17,7 +17,7 @@ #include "cctk_Parameters.h" extern "C" { - static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOHDF5/src/iohdf5.cc,v 1.1 2004/03/03 09:44:26 schnetter Exp $"; + static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOHDF5/src/iohdf5.cc,v 1.2 2004/03/03 13:07:01 schnetter Exp $"; CCTK_FILEVERSION(Carpet_CarpetIOHDF5_iohdf5_cc); } @@ -1051,6 +1051,12 @@ namespace CarpetIOHDF5 { values[i] = values1[i]; } + herr = H5Tclose (datatype); + assert (!herr); + + herr = H5Sclose (dataspace); + assert (!herr); + herr = H5Aclose (attribute); assert (!herr); @@ -1104,6 +1110,12 @@ namespace CarpetIOHDF5 { values[i] = values1[i]; } + herr = H5Tclose (datatype); + assert (!herr); + + herr = H5Sclose (dataspace); + assert (!herr); + herr = H5Aclose (attribute); assert (!herr); @@ -1146,6 +1158,15 @@ namespace CarpetIOHDF5 { assert (!herr); values[length] = '\0'; + herr = H5Tclose (datatype); + assert (!herr); + + herr = H5Sclose (dataspace); + assert (!herr); + + herr = H5Aclose (attribute); + assert (!herr); + return length; } @@ -1182,6 +1203,12 @@ namespace CarpetIOHDF5 { values[i] = values1[i]; } + herr = H5Tclose (datatype); + assert (!herr); + + herr = H5Sclose (dataspace); + assert (!herr); + herr = H5Aclose (attribute); assert (!herr); -- cgit v1.2.3