Unverified Commit 3593d371 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #2285 from twhitehead/comm-for-fix-destructors

Move comm destruction to after modify to leave available for fixes
parents 15cd007d 13700905
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -854,9 +854,6 @@ void LAMMPS::destroy()
  delete neighbor;
  delete neighbor;
  neighbor = NULL;
  neighbor = NULL;


  delete comm;
  comm = NULL;

  delete force;
  delete force;
  force = NULL;
  force = NULL;


@@ -870,6 +867,10 @@ void LAMMPS::destroy()
                          //   since they delete fixes
                          //   since they delete fixes
  modify = NULL;
  modify = NULL;


  delete comm;            // comm must come after modify
                          //   since fix destructors may access comm
  comm = NULL;

  delete domain;          // domain must come after modify
  delete domain;          // domain must come after modify
                          //   since fix destructors access domain
                          //   since fix destructors access domain
  domain = NULL;
  domain = NULL;