Fix memory leak
This commit is contained in:
@ -36,6 +36,7 @@ static constexpr int BUFEXTRA = 1000;
|
|||||||
|
|
||||||
CommTiledKokkos::CommTiledKokkos(LAMMPS *_lmp) : CommTiled(_lmp)
|
CommTiledKokkos::CommTiledKokkos(LAMMPS *_lmp) : CommTiled(_lmp)
|
||||||
{
|
{
|
||||||
|
sendlist = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -47,6 +48,7 @@ CommTiledKokkos::CommTiledKokkos(LAMMPS *_lmp) : CommTiled(_lmp)
|
|||||||
|
|
||||||
CommTiledKokkos::CommTiledKokkos(LAMMPS *_lmp, Comm *oldcomm) : CommTiled(_lmp,oldcomm)
|
CommTiledKokkos::CommTiledKokkos(LAMMPS *_lmp, Comm *oldcomm) : CommTiled(_lmp,oldcomm)
|
||||||
{
|
{
|
||||||
|
sendlist = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -57,7 +59,6 @@ CommTiledKokkos::~CommTiledKokkos()
|
|||||||
sendlist = nullptr;
|
sendlist = nullptr;
|
||||||
buf_send = nullptr;
|
buf_send = nullptr;
|
||||||
buf_recv = nullptr;
|
buf_recv = nullptr;
|
||||||
maxswap = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -2468,8 +2468,10 @@ void CommTiled::deallocate_swap(int n)
|
|||||||
|
|
||||||
delete [] maxsendlist[i];
|
delete [] maxsendlist[i];
|
||||||
|
|
||||||
for (int j = 0; j < nprocmax[i]; j++) memory->destroy(sendlist[i][j]);
|
if (sendlist && sendlist[i]) {
|
||||||
delete [] sendlist[i];
|
for (int j = 0; j < nprocmax[i]; j++) memory->destroy(sendlist[i][j]);
|
||||||
|
delete [] sendlist[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete [] sendproc;
|
delete [] sendproc;
|
||||||
|
|||||||
Reference in New Issue
Block a user