aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2019-05-01 12:07:11 -0700
committerGravatar Remi Lehe <remi.lehe@normalesup.org> 2019-05-01 12:07:11 -0700
commitf07d411bc3b6110a48e70a6b69907d5f7100759d (patch)
tree70b9a124bacdf9d1f45b5d968f7001e0b237f8e7 /Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H
parente4985aa4188ce6f9605171db2a1c621ecc730e26 (diff)
downloadWarpX-f07d411bc3b6110a48e70a6b69907d5f7100759d.tar.gz
WarpX-f07d411bc3b6110a48e70a6b69907d5f7100759d.tar.zst
WarpX-f07d411bc3b6110a48e70a6b69907d5f7100759d.zip
Add virtual destructor
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H')
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H
index 5c662e533..602eb2473 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H
@@ -17,6 +17,10 @@ class SpectralBaseAlgorithm
// Member function that updates the fields in spectral space ;
// meant to be overridden in subclasses
virtual void pushSpectralFields(SpectralFieldData& f) const = 0;
+ // The destructor should also be a virtual function, so that
+ // a pointer to subclass of `SpectraBaseAlgorithm` actually
+ // calls the subclass's destructor.
+ virtual ~SpectralBaseAlgorithm() {};
protected: // Meant to be used in the subclasses