must destroy before allocate to avoid leaking

This commit is contained in:
Axel Kohlmeyer
2024-08-02 17:41:39 -04:00
parent d3919be102
commit b41b2c9bfc
2 changed files with 2 additions and 0 deletions

View File

@ -54,6 +54,7 @@ void FixQEqPoint::init()
neighbor->add_request(this, NeighConst::REQ_FULL); neighbor->add_request(this, NeighConst::REQ_FULL);
int ntypes = atom->ntypes; int ntypes = atom->ntypes;
memory->destroy(shld);
memory->create(shld, ntypes + 1, ntypes + 1, "qeq:shielding"); memory->create(shld, ntypes + 1, ntypes + 1, "qeq:shielding");
} }

View File

@ -56,6 +56,7 @@ void FixQEqShielded::init()
neighbor->add_request(this, NeighConst::REQ_FULL); neighbor->add_request(this, NeighConst::REQ_FULL);
const int ntypes = atom->ntypes; const int ntypes = atom->ntypes;
memory->destroy(shld);
memory->create(shld, ntypes + 1, ntypes + 1, "qeq:shielding"); memory->create(shld, ntypes + 1, ntypes + 1, "qeq:shielding");
init_shielding(); init_shielding();