Define destructor in .cpp to handle forward-def field

The EclipseSummary field is just forward declared in the header, and
the compiler cannot create a proper destructor based on just that. If
we define it in the compilation unit, it will get instantiated there
once and for all and the compiler won't try to create it (and leave it
to the linker to sort out duplicates) everywhere the header is used
(which may be in another module, even).

This is similar to commit 18b9f2b for SimulatorOutput.
This commit is contained in:
Roland Kaufmann 2013-11-21 14:57:19 +01:00
parent 8e6ccadfc3
commit 419cffe73b
2 changed files with 9 additions and 0 deletions

View File

@ -938,4 +938,7 @@ EclipseWriter::EclipseWriter (
}
}
// default destructor is OK, just need to be defined
EclipseWriter::~EclipseWriter() { }
} // namespace Opm

View File

@ -64,6 +64,12 @@ public:
std::shared_ptr <const EclipseGridParser> parser,
std::shared_ptr <const UnstructuredGrid> grid);
/**
* We need a destructor in the compilation unit to avoid the
* EclipseSummary being a complete type here.
*/
virtual ~EclipseWriter ();
/*!
* \brief Write the static eclipse data (grid, PVT curves, etc) to disk
*/