JeffersonLab / qphix

QCD for Intel Xeon Phi and Xeon processors
http://jeffersonlab.github.io/qphix/
Other
13 stars 11 forks source link

memory leak: abstract base classes need destructors #66

Closed kostrzewa closed 7 years ago

kostrzewa commented 7 years ago

When using the abstract base classes, QPhiX::EvenOddLinearOperator and QPhiX::AbstractSolver, the lack of virtual destructors leads to severe memory leaks.

kostrzewa commented 7 years ago

In tmLQCD, we use pointers to the abstract classes to hold pointers to the derived classes.

martin-ueding commented 7 years ago

Yes, a virtual destructor is a must for a base class, I should have thought of that. The 1+1 stuff looks promising, I will take of this next, then.

martin-ueding commented 7 years ago

Should be fixed now, I have included a virtual dtor with an empty default implementation.