From 3c94f7d5d16b7e2def4c9acce8a512fc80f6f402 Mon Sep 17 00:00:00 2001
From: Axel Kohlmeyer <akohlmey@gmail.com>
Date: Mon, 19 Mar 2018 18:03:13 -0400
Subject: [PATCH] add pointer Force class to temporarily hold the name of the
 restarted pair style

---
 src/force.cpp | 6 ++++++
 src/force.h   | 1 +
 2 files changed, 7 insertions(+)

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;
-- 
GitLab