Commit 9ef725ea authored by Anne Gunn's avatar Anne Gunn
Browse files

Move destruction of splines data structure to FixBocs destructor

from ComputePressure destructor.
parent e11a3c47
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -115,6 +115,7 @@ ComputePressureBocs::ComputePressureBocs(LAMMPS *lmp, int narg, char **arg) :
  vector = new double[size_vector];
  nvirial = 0;
  vptr = NULL;

  splines = NULL;
  spline_length = 0;
}
@@ -127,10 +128,6 @@ ComputePressureBocs::~ComputePressureBocs()
  delete [] vector;
  delete [] vptr;
  if (phi_coeff) free(phi_coeff);

  // Any splines data that was sent in from fix_bocs must be
  // freed here, after it has been used.
  memory->destroy(splines);
}

/* ---------------------------------------------------------------------- */
+9 −0
Original line number Diff line number Diff line
@@ -118,6 +118,9 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) :

  p_match_coeffs = NULL;

  splines = NULL;
  spline_length = 0;

  // turn on tilt factor scaling, whenever applicable

  dimension = domain->dimension;
@@ -476,6 +479,12 @@ FixBocs::~FixBocs()
    }
  }
  if (p_match_coeffs) free(p_match_coeffs);

    // Free splines memory structure
    if (splines != NULL) {
        memory->destroy(splines);
        spline_length = 0;
    }
}

/* ---------------------------------------------------------------------- */