avoid resource leak

This commit is contained in:
Axel Kohlmeyer
2022-06-14 10:36:21 -04:00
parent 7a64d1358e
commit 6abb316dba

View File

@ -44,7 +44,7 @@ static const double sqrt_2_inv = std::sqrt(0.5);
/* ---------------------------------------------------------------------- */
PairSDPDTaitwaterIsothermal::PairSDPDTaitwaterIsothermal (LAMMPS *lmp)
: Pair (lmp) {
: Pair (lmp), random(nullptr) {
restartinfo = 0;
single_enable =0;
}
@ -61,6 +61,7 @@ PairSDPDTaitwaterIsothermal::~PairSDPDTaitwaterIsothermal () {
memory->destroy (soundspeed);
memory->destroy (B);
}
delete random;
}
/* ---------------------------------------------------------------------- */