Commit c44620f0 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

make sure all class pointers in the LAMMPS class are initialized to NULL

some early use of the LAMMPS class may produce segmentation faults,
if member classes are not yet initialized and their pointers are
pointing to random locations. For NULL we can easily test.
parent a5f75bba
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -65,13 +65,15 @@ static void print_style(FILE *fp, const char *str, int &pos);
   input is allocated at end after MPI info is setup
------------------------------------------------------------------------- */

LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) :
  memory(NULL), error(NULL), universe(NULL), input(NULL), atom(NULL),
  update(NULL), neighbor(NULL), comm(NULL), domain(NULL), force(NULL),
  modify(NULL), group(NULL), output(NULL), timer(NULL), kokkos(NULL),
  atomKK(NULL), memoryKK(NULL), python(NULL), citeme(NULL)
{
  memory = new Memory(this);
  error = new Error(this);
  universe = new Universe(this,communicator);
  output = NULL;
  python = NULL;

  clientserver = 0;
  cslib = NULL;