diff --git a/src/atom.cpp b/src/atom.cpp index 053a18430b2d9fdf6d8ebeaf6d59f04f3eb24843..6b3427c04ee5ed3aeb2d1ed22c2eac3cdf981c7b 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -390,6 +390,8 @@ void Atom::create_avec(const char *style, int narg, char **arg, int trysuffix) { delete [] atom_style; if (avec) delete avec; + atom_style = NULL; + avec = NULL; // unset atom style and array existence flags // may have been set by old avec diff --git a/src/force.cpp b/src/force.cpp index 95a6ff4f6dfba3a9b961122ede35191a44cf9a69..3dd28cc7105ba2b09694ae23aa11ab339c115ad5 100644 --- a/src/force.cpp +++ b/src/force.cpp @@ -195,6 +195,8 @@ void Force::create_pair(const char *style, int trysuffix) { delete [] pair_style; if (pair) delete pair; + pair_style = NULL; + pair = NULL; int sflag; pair = new_pair(style,trysuffix,sflag); diff --git a/src/neighbor.cpp b/src/neighbor.cpp index b02d88955c3353b3a2664f80f1f540a39ef27bc2..59abc29f19f2875cc6da0737768b261699b1d1b7 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -73,7 +73,8 @@ static const char cite_neigh_multi[] = /* ---------------------------------------------------------------------- */ -Neighbor::Neighbor(LAMMPS *lmp) : Pointers(lmp) +Neighbor::Neighbor(LAMMPS *lmp) : Pointers(lmp), +pairclass(NULL), pairnames(NULL), pairmasks(NULL) { MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs);