Skip to content

Commit

Permalink
Fix virtual destructors
Browse files Browse the repository at this point in the history
  • Loading branch information
davschneller committed Dec 29, 2023
1 parent 5613804 commit 66bd465
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/input/MeshData.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class MeshData {

class FullStorageMeshData : public MeshData {
public:
virtual ~FullStorageMeshData() = default;

virtual std::size_t cellCount() { return cellCountValue; }
virtual std::size_t vertexCount() { return vertexCountValue; }

Expand Down
2 changes: 1 addition & 1 deletion src/input/MeshInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ApfMeshInput : public FullStorageMeshData {
public:
apf::Mesh2* getMesh() { return m_mesh; }

~ApfMeshInput() {
virtual ~ApfMeshInput() {
delete m_mesh;
m_mesh = nullptr;
}
Expand Down
2 changes: 2 additions & 0 deletions src/input/NetCDFMesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
*/
class NetCDFMesh : public FullStorageMeshData {
public:
virtual ~NetCDFMesh() = default;

NetCDFMesh(const char* meshFile, MPI_Comm comm = MPI_COMM_WORLD) {
int rank = 0;
int nProcs = 1;
Expand Down
3 changes: 3 additions & 0 deletions src/input/SerialMeshFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
* Read a mesh from a serial file
*/
template <typename T> class SerialMeshFile : public FullStorageMeshData {
public:
virtual ~SerialMeshFile() = default;

private:
#ifdef PARALLEL
MPI_Comm m_comm;
Expand Down
2 changes: 1 addition & 1 deletion src/pumgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ int main(int argc, char* argv[]) {
case 6:
#ifdef USE_SIMMOD
#ifdef USE_SCOREC
logInfo(rank) << "Using SimModSuite (with APF)";
logInfo(rank) << "Using SimModSuite with APF (deprecated)";

meshInput = new SimModSuiteApf(
inputFile, args.getArgument<const char*>("cad", 0L),
Expand Down

0 comments on commit 66bd465

Please sign in to comment.