must not try to delete computes if they have not been created and their ids not yet set

This commit is contained in:
Axel Kohlmeyer
2020-08-26 11:50:20 -04:00
parent c8af729701
commit f89a0f9fe3

View File

@ -41,14 +41,17 @@ ResetMolIDs::ResetMolIDs(LAMMPS *lmp) : Pointers(lmp) {
compressflag = 1; compressflag = 1;
singleflag = 0; singleflag = 0;
offset = -1; offset = -1;
idfrag.clear();
idchunk.clear();
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
ResetMolIDs::~ResetMolIDs() ResetMolIDs::~ResetMolIDs()
{ {
modify->delete_compute(idfrag); if (!idfrag.empty()) modify->delete_compute(idfrag);
if (compressflag) modify->delete_compute(idchunk); if (compressflag && !idchunk.empty()) modify->delete_compute(idchunk);
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------