Unverified Commit f89a0f9f authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

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

parent c8af7297
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -41,14 +41,17 @@ ResetMolIDs::ResetMolIDs(LAMMPS *lmp) : Pointers(lmp) {
  compressflag = 1;
  singleflag = 0;
  offset = -1;

  idfrag.clear();
  idchunk.clear();
}

/* ---------------------------------------------------------------------- */

ResetMolIDs::~ResetMolIDs()
{
  modify->delete_compute(idfrag);
  if (compressflag) modify->delete_compute(idchunk);
  if (!idfrag.empty()) modify->delete_compute(idfrag);
  if (compressflag && !idchunk.empty()) modify->delete_compute(idchunk);
}

/* ----------------------------------------------------------------------