From 7730cc64cebfeacff8ac3d8669b4d52e0a2022dd Mon Sep 17 00:00:00 2001 From: Lu Date: Thu, 28 May 2020 18:00:32 +0800 Subject: [PATCH] fix bug of memory leak --- source/lib/src/NNPInter.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/lib/src/NNPInter.cc b/source/lib/src/NNPInter.cc index f526cad911..aea9d48c9b 100644 --- a/source/lib/src/NNPInter.cc +++ b/source/lib/src/NNPInter.cc @@ -285,6 +285,7 @@ void NNPInter::update_nbor(const InternalNeighborList & nlist, const int nloc) { ilist_size = nlist.ilist.size(); jrange_size = nlist.jrange.size(); jlist_size = nlist.jlist.size(); + init_nbor = true; } if (ilist_size < nlist.ilist.size()) { cudaErrcheck(cudaFree(ilist)); @@ -832,6 +833,7 @@ update_nbor(const InternalNeighborList & nlist, const int nloc) ilist_size = nlist.ilist.size(); jrange_size = nlist.jrange.size(); jlist_size = nlist.jlist.size(); + init_nbor = true; } if (ilist_size < nlist.ilist.size()) { cudaErrcheck(cudaFree(ilist));