From 05fbf93455189f5eaac373cf52b32a7feb56f7d2 Mon Sep 17 00:00:00 2001
From: Axel Kohlmeyer <akohlmey@gmail.com>
Date: Fri, 23 Jun 2017 10:37:00 -0400
Subject: [PATCH] skip deleting internal data before setup has been run

---
 src/USER-OMP/pair_reaxc_omp.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/USER-OMP/pair_reaxc_omp.cpp b/src/USER-OMP/pair_reaxc_omp.cpp
index 91fa3d38c7..45c4bce0c0 100644
--- a/src/USER-OMP/pair_reaxc_omp.cpp
+++ b/src/USER-OMP/pair_reaxc_omp.cpp
@@ -84,10 +84,11 @@ PairReaxCOMP::PairReaxCOMP(LAMMPS *lmp) : PairReaxC(lmp), ThrOMP(lmp, THR_PAIR)
 
 PairReaxCOMP::~PairReaxCOMP()
 {
-  reax_list * bonds = lists+BONDS;
-  for (int i=0; i<bonds->num_intrs; ++i)
-    sfree(bonds->select.bond_list[i].bo_data.CdboReduction, "CdboReduction");
-
+  if (setup_flag) {
+    reax_list * bonds = lists+BONDS;
+    for (int i=0; i<bonds->num_intrs; ++i)
+      sfree(bonds->select.bond_list[i].bo_data.CdboReduction, "CdboReduction");
+  }
   memory->destroy(num_nbrs_offset);
 
 #ifdef OMP_TIMING
-- 
GitLab