must bracket 'memory->destroy()' calls in destructor with 'if (allocated)'

This commit is contained in:
Axel Kohlmeyer 2019-03-22 04:55:13 -04:00
parent 1e8ccb1774
commit 8f90d6c6d0
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 3 additions and 1 deletions

View File

@ -42,7 +42,9 @@ PairBuckCoulCut::PairBuckCoulCut(LAMMPS *lmp) : Pair(lmp)
PairBuckCoulCut::~PairBuckCoulCut()
{
if (!copymode) {
if (copymode) return;
if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);