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:
parent
8e6ccadfc3
commit
419cffe73b
@ -938,4 +938,7 @@ EclipseWriter::EclipseWriter (
|
||||
}
|
||||
}
|
||||
|
||||
// default destructor is OK, just need to be defined
|
||||
EclipseWriter::~EclipseWriter() { }
|
||||
|
||||
} // namespace Opm
|
||||
|
@ -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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user