remove unused class members and plug memory leaks

This commit is contained in:
Axel Kohlmeyer
2025-04-10 04:39:56 -04:00
parent 32592e6660
commit 227b4ed12d
2 changed files with 15 additions and 1 deletions

View File

@ -66,6 +66,20 @@ enum { BISECTION, QUASIRANDOM };
static constexpr const char *mesh_name[] = {"recursive bisection", "quasi-random"};
/* ---------------------------------------------------------------------- */
CreateAtoms::~CreateAtoms()
{
delete[] basistype;
memory->destroy(xmol);
delete[] vstr;
delete[] xstr;
delete[] ystr;
delete[] zstr;
delete[] groupname;
delete ranmol;
delete ranlat;
}
CreateAtoms::CreateAtoms(LAMMPS *lmp) : Command(lmp), basistype(nullptr) {}
/* ---------------------------------------------------------------------- */

View File

@ -27,6 +27,7 @@ namespace LAMMPS_NS {
class CreateAtoms : public Command {
public:
CreateAtoms(class LAMMPS *);
~CreateAtoms() override;
void command(int, char **) override;
private:
@ -45,7 +46,6 @@ class CreateAtoms : public Command {
int varflag, vvar, xvar, yvar, zvar;
char *vstr, *xstr, *ystr, *zstr;
char *xstr_copy, *ystr_copy, *zstr_copy;
int ilo, ihi, jlo, jhi, klo, khi;