plug memory leaks
This commit is contained in:
@ -321,6 +321,7 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (expand) {
|
if (expand) {
|
||||||
for (int i = 0; i < nargnew; i++) delete[] earg[i];
|
for (int i = 0; i < nargnew; i++) delete[] earg[i];
|
||||||
memory->sfree(earg);
|
memory->sfree(earg);
|
||||||
|
memory->sfree(amap);
|
||||||
}
|
}
|
||||||
|
|
||||||
// allocate and initialize memory for calculated values and correlators
|
// allocate and initialize memory for calculated values and correlators
|
||||||
|
|||||||
@ -78,6 +78,7 @@ ComputeChunkSpreadAtom(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (expand) {
|
if (expand) {
|
||||||
for (int i = 0; i < nargnew; i++) delete[] earg[i];
|
for (int i = 0; i < nargnew; i++) delete[] earg[i];
|
||||||
memory->sfree(earg);
|
memory->sfree(earg);
|
||||||
|
memory->sfree(amap);
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup and error check
|
// setup and error check
|
||||||
|
|||||||
@ -89,6 +89,7 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (expand) {
|
if (expand) {
|
||||||
for (int i = 0; i < nargnew; i++) delete [] earg[i];
|
for (int i = 0; i < nargnew; i++) delete [] earg[i];
|
||||||
memory->sfree(earg);
|
memory->sfree(earg);
|
||||||
|
memory->sfree(amap);
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup and error check for both, index arg and values
|
// setup and error check for both, index arg and values
|
||||||
|
|||||||
@ -257,6 +257,7 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (expand) {
|
if (expand) {
|
||||||
for (int i = 0; i < nargnew; i++) delete[] earg[i];
|
for (int i = 0; i < nargnew; i++) delete[] earg[i];
|
||||||
memory->sfree(earg);
|
memory->sfree(earg);
|
||||||
|
memory->sfree(amap);
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup and error check
|
// setup and error check
|
||||||
|
|||||||
@ -92,6 +92,7 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (expand) {
|
if (expand) {
|
||||||
for (int i = 0; i < nargnew; i++) delete[] earg[i];
|
for (int i = 0; i < nargnew; i++) delete[] earg[i];
|
||||||
memory->sfree(earg);
|
memory->sfree(earg);
|
||||||
|
memory->sfree(amap);
|
||||||
}
|
}
|
||||||
|
|
||||||
// error check
|
// error check
|
||||||
|
|||||||
@ -355,6 +355,7 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (expand) {
|
if (expand) {
|
||||||
for (int i = 0; i < nargnew; i++) delete[] earg[i];
|
for (int i = 0; i < nargnew; i++) delete[] earg[i];
|
||||||
memory->sfree(earg);
|
memory->sfree(earg);
|
||||||
|
memory->sfree(amap);
|
||||||
}
|
}
|
||||||
|
|
||||||
// this fix produces a global array
|
// this fix produces a global array
|
||||||
|
|||||||
@ -277,6 +277,7 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (expand) {
|
if (expand) {
|
||||||
for (int i = 0; i < nargnew; i++) delete[] earg[i];
|
for (int i = 0; i < nargnew; i++) delete[] earg[i];
|
||||||
memory->sfree(earg);
|
memory->sfree(earg);
|
||||||
|
memory->sfree(amap);
|
||||||
}
|
}
|
||||||
|
|
||||||
// allocate and initialize memory for averaging
|
// allocate and initialize memory for averaging
|
||||||
|
|||||||
Reference in New Issue
Block a user