avoid memory leak in pair style sw/intel
This commit is contained in:
@ -1292,6 +1292,11 @@ void PairSWIntel::ForceConst<flt_t>::set_ntypes(const int ntypes,
|
||||
_memory->destroy(op2e);
|
||||
_memory->destroy(op3);
|
||||
}
|
||||
memory->destroy(p2);
|
||||
memory->create(p2f);
|
||||
memory->create(p2f2);
|
||||
memory->create(p2e);
|
||||
memory->create(p3);
|
||||
if (ntypes > 0) {
|
||||
_cop = cop;
|
||||
memory->create(p2,ntypes,ntypes,"fc.p2");
|
||||
|
||||
@ -87,7 +87,7 @@ class PairSWIntel : public PairSW {
|
||||
fc_packed2 **p2e;
|
||||
fc_packed3 ***p3;
|
||||
|
||||
ForceConst() : _ntypes(0) {}
|
||||
ForceConst() : _ntypes(0), p2(0), p2f(0), p2f2(0), p2e(0), p3(0) {}
|
||||
~ForceConst() { set_ntypes(0, NULL, _cop); }
|
||||
|
||||
void set_ntypes(const int ntypes, Memory *memory, const int cop);
|
||||
|
||||
Reference in New Issue
Block a user