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

fix memory leak in pair style sw/intel for good

parent 510d5277
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -1286,17 +1286,12 @@ void PairSWIntel::ForceConst<flt_t>::set_ntypes(const int ntypes,
      }
      #endif

      _memory->destroy(op2);
      _memory->destroy(op2f);
      _memory->destroy(op2f2);
      _memory->destroy(op2e);
      _memory->destroy(op3);
    }
      memory->destroy(p2);
      memory->destroy(p2f);
      memory->destroy(p2f2);
      memory->destroy(p2e);
      memory->destroy(p3);
    }
    if (ntypes > 0) {
      _cop = cop;
      memory->create(p2,ntypes,ntypes,"fc.p2");
+1 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ class PairSWIntel : public PairSW {
    fc_packed2 **p2e;
    fc_packed3 ***p3;

    ForceConst() : _ntypes(0), p2(0), p2f(0), p2f2(0), p2e(0), p3(0)  {}
    ForceConst() : p2(0), p2f(0), p2f2(0), p2e(0), p3(0), _ntypes(0)  {}
    ~ForceConst() { set_ntypes(0, NULL, _cop); }

    void set_ntypes(const int ntypes, Memory *memory, const int cop);