From: malaterre Date: Thu, 12 Jun 2003 16:58:31 +0000 (+0000) Subject: Memory fixes (valgrind need to be run on .libs/vtkgdcmdemo and not the script). X-Git-Tag: Version0.3~29 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=9d4af637535366b0741e3315b83b6b50582d46d6;p=gdcm.git Memory fixes (valgrind need to be run on .libs/vtkgdcmdemo and not the script). Change a empty() -> clear() --- diff --git a/vtk/vtkGdcmReader.cxx b/vtk/vtkGdcmReader.cxx index 90d0a6dc..4a18c5ac 100644 --- a/vtk/vtkGdcmReader.cxx +++ b/vtk/vtkGdcmReader.cxx @@ -1,4 +1,4 @@ -// $Header: /cvs/public/gdcm/vtk/vtkGdcmReader.cxx,v 1.10 2003/06/11 13:36:54 frog Exp $ +// $Header: /cvs/public/gdcm/vtk/vtkGdcmReader.cxx,v 1.11 2003/06/12 16:58:31 malaterre Exp $ //CLEANME#include #include #include @@ -16,6 +16,7 @@ vtkGdcmReader::vtkGdcmReader() vtkGdcmReader::~vtkGdcmReader() { // FIXME free memory + this->FileNameList.clear(); } //---------------------------------------------------------------------------- @@ -28,6 +29,7 @@ void vtkGdcmReader::AddFileName(const char* name) strcpy(LocalName, name); this->FileNameList.push_back(LocalName); this->Modified(); + delete[] LocalName; } //---------------------------------------------------------------------------- @@ -37,7 +39,7 @@ void vtkGdcmReader::SetFileName(const char *name) { // Since we maintain a list of filenames, when building a volume, // (see vtkGdcmReader::AddFileName), we additionaly need to purge // this list when we manually positionate the filename: - this->FileNameList.empty(); + this->FileNameList.clear(); this->Modified(); }