Unverified Commit 32870951 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

plug memory leaks in pair style comb and comb3

parent fcdd2c50
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1335,6 +1335,18 @@ void PairComb::sm_table()

  // allocate arrays

  memory->sfree(sht_first);
  memory->destroy(intype);
  memory->destroy(fafb);
  memory->destroy(dfafb);
  memory->destroy(ddfafb);
  memory->destroy(phin);
  memory->destroy(dphin);
  memory->destroy(erpaw);
  memory->destroy(NCo);
  memory->destroy(bbij);
  memory->destroy(sht_num);

  memory->create(intype,n,n,"pair:intype");
  memory->create(fafb,ncoul,nntypes,"pair:fafb");
  memory->create(dfafb,ncoul,nntypes,"pair:dfafb");
+20 −0
Original line number Diff line number Diff line
@@ -2258,6 +2258,26 @@ void PairComb3::tables()

  int n = nelements;

  memory->destroy(intype);
  memory->destroy(erpaw);
  memory->destroy(fafb);
  memory->destroy(dfafb);
  memory->destroy(ddfafb);
  memory->destroy(phin);
  memory->destroy(dphin);
  memory->destroy(afb);
  memory->destroy(dafb);
  memory->destroy(vvdw);
  memory->destroy(vdvdw);
  memory->destroy(dpl);
  memory->destroy(bbij);
  memory->destroy(xcctmp);
  memory->destroy(xchtmp);
  memory->destroy(xcotmp);
  memory->destroy(NCo);
  memory->destroy(sht_num);
  memory->sfree(sht_first);

  dra  = 0.001;
  drin = 0.100;
  drbuf = 0.100;