Commit 0cfa71b5 authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles

fix hdf5 issue

parent 2f3eebcb
......@@ -593,6 +593,9 @@ CSnapshotGadgetH5Out<T>::CSnapshotGadgetH5Out(const std::string _n, const std::s
template <class T>
CSnapshotGadgetH5Out<T>::~CSnapshotGadgetH5Out()
{
if (myH5) {
delete myH5;
}
}
// ----------------------------------------------------------------------------
// putHeader
......@@ -808,6 +811,7 @@ int CSnapshotGadgetH5Out<T>::save()
myH5->setAttribute("NumPart_Total",&header.NumPart_Total[0],header.NumPart_Total.size());
myH5->setAttribute("NumPart_Total_HighWord",&header.NumPart_Total_HighWord[0],header.NumPart_Total_HighWord.size());
myH5->close();
return fail;
}
// ----------------------------------------------------------------------------
......
......@@ -58,6 +58,17 @@ public:
GH5(const std::string _f_name,unsigned int mode, const bool verb=false);
~GH5();
t_h5_header getHeader() { return header; }
int close() {
int status=0;
if (myfile) {
header_group.close(); // ! necessary to close this opened group
myfile->close();
//delete myfile;
//myfile=NULL;
status=1;
}
return status;
}
// reading
template <class U> std::vector<U> getDataset(std::string dset_name, U );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment