Skip to content

Commit

Permalink
Bugs: Missing Virtual Destructors
Browse files Browse the repository at this point in the history
As soon as a class implements virtual functions, it must also provide
a virtual destructor.
  • Loading branch information
ax3l committed Dec 13, 2019
1 parent c011917 commit 7d5b0ce
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/openPMD/Iteration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class Iteration : public Attributable
Container< Mesh > meshes;
Container< ParticleSpecies > particles; //particleSpecies?

virtual ~Iteration() = default;
private:
Iteration();

Expand Down
2 changes: 2 additions & 0 deletions include/openPMD/RecordComponent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ class RecordComponent : public BaseRecordComponent

static constexpr char const * const SCALAR = "\vScalar";

virtual ~RecordComponent() = default;

OPENPMD_protected:
RecordComponent();

Expand Down
2 changes: 1 addition & 1 deletion include/openPMD/backend/BaseRecord.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class BaseRecord : public Container< T_elem >

BaseRecord(BaseRecord const& b);
BaseRecord& operator=(BaseRecord const& b);
~BaseRecord() override { }
virtual ~BaseRecord() = default;

mapped_type& operator[](key_type const& key) override;
mapped_type& operator[](key_type&& key) override;
Expand Down
2 changes: 1 addition & 1 deletion src/IO/AbstractIOHandlerHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
* and the GNU Lesser General Public License along with openPMD-api.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <openPMD/IO/ADIOS/ADIOS2IOHandler.hpp>
#include "openPMD/IO/AbstractIOHandlerHelper.hpp"
#include "openPMD/IO/DummyIOHandler.hpp"
#include "openPMD/IO/ADIOS/ADIOS1IOHandler.hpp"
#include "openPMD/IO/ADIOS/ParallelADIOS1IOHandler.hpp"
#include "openPMD/IO/ADIOS/ADIOS2IOHandler.hpp"
#include "openPMD/IO/HDF5/HDF5IOHandler.hpp"
#include "openPMD/IO/HDF5/ParallelHDF5IOHandler.hpp"
#include "openPMD/IO/JSON/JSONIOHandler.hpp"
Expand Down

0 comments on commit 7d5b0ce

Please sign in to comment.