diff --git a/src/force.cpp b/src/force.cpp index 060cae10eb..2575f262d9 100644 --- a/src/force.cpp +++ b/src/force.cpp @@ -78,6 +78,8 @@ Force::Force(LAMMPS *lmp) : Pointers(lmp) kspace_style = new char[n]; strcpy(kspace_style,str); + pair_restart = NULL; + // fill pair map with pair styles listed in style_pair.h pair_map = new PairCreatorMap(); @@ -146,6 +148,8 @@ Force::~Force() delete [] improper_style; delete [] kspace_style; + delete [] pair_restart; + if (pair) delete pair; if (bond) delete bond; if (angle) delete angle; @@ -197,8 +201,10 @@ void Force::create_pair(const char *style, int trysuffix) { delete [] pair_style; if (pair) delete pair; + if (pair_restart) delete [] pair_restart; pair_style = NULL; pair = NULL; + pair_restart = NULL; int sflag; pair = new_pair(style,trysuffix,sflag); diff --git a/src/force.h b/src/force.h index edaac1b527..9ea0ec4201 100644 --- a/src/force.h +++ b/src/force.h @@ -50,6 +50,7 @@ class Force : protected Pointers { class Pair *pair; char *pair_style; + char *pair_restart; class Bond *bond; char *bond_style;