Skip to content

Commit

Permalink
Fixed memory leak in FilerReader.
Browse files Browse the repository at this point in the history
  • Loading branch information
dafer45 committed Nov 14, 2018
1 parent 2f5fa72 commit 4e4d3a4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Lib/src/Utilities/FileReader.cpp
Expand Up @@ -698,6 +698,7 @@ Property::Density* FileReader::readDensity(string name, string path){

density = new Property::Density(*indexTree, data);

delete indexTree;
delete [] dims;
delete [] data;

Expand Down Expand Up @@ -848,6 +849,7 @@ Property::Magnetization* FileReader::readMagnetization(

magnetization = new Property::Magnetization(*indexTree, data);

delete indexTree;
delete [] dims;
delete [] data_internal;
delete [] data;
Expand Down Expand Up @@ -1006,6 +1008,7 @@ Property::LDOS* FileReader::readLDOS(string name, string path){
data
);

delete indexTree;
delete [] dims;
delete [] data;

Expand Down Expand Up @@ -1187,6 +1190,7 @@ Property::SpinPolarizedLDOS* FileReader::readSpinPolarizedLDOS(
data
);

delete indexTree;
delete [] dims;
delete [] data_internal;
delete [] data;
Expand Down

0 comments on commit 4e4d3a4

Please sign in to comment.