mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-24 22:27:55 -05:00
#14376 Guard ODB API calls in RifOdbReader destructor
This commit is contained in:
1 parent
7c10106545
commit
f409fd8a4d
1 file changed
+16
-2
@@ -119,11 +119,25 @@ RifOdbReader::RifOdbReader()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifOdbReader::~RifOdbReader()
|
||||
{
|
||||
close();
|
||||
// The ODB API can throw from close() and odb_finalizeAPI(). An exception escaping the
|
||||
// destructor calls std::terminate, taking down the application during project close.
|
||||
try
|
||||
{
|
||||
close();
|
||||
}
|
||||
catch ( ... )
|
||||
{
|
||||
}
|
||||
|
||||
if ( --sm_instanceCount == 0 )
|
||||
{
|
||||
odb_finalizeAPI();
|
||||
try
|
||||
{
|
||||
odb_finalizeAPI();
|
||||
}
|
||||
catch ( ... )
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user