delete is safe for null pointers

This commit is contained in:
Axel Kohlmeyer
2025-07-04 05:10:30 -04:00
parent c6c7131088
commit 9a7c08c7e9

View File

@ -56,7 +56,7 @@ template <typename T> static Dump *dump_creator(LAMMPS *lmp, int narg, char ** a
initialize all output
------------------------------------------------------------------------- */
Output::Output(LAMMPS *lmp) : Pointers(lmp)
Output::Output(LAMMPS *lmp) : Pointers(lmp), thermo(nullptr)
{
// create default computes for temp,pressure,pe
@ -132,7 +132,7 @@ Output::~Output()
delete dump_map;
if (thermo) delete thermo;
delete thermo;
delete[] var_thermo;
}