From 165c7718fa66f62998dffd281002331db46646a6 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 24 Jan 2024 08:16:17 +0100 Subject: [PATCH] Disconnect comparison view in destructor of RimEclipseResultCase In debug build on Windows, a crash in the destructor of Rim3dView happens when the comparison view is set to null. --- .../ProjectDataModel/RimEclipseResultCase.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ApplicationLibCode/ProjectDataModel/RimEclipseResultCase.cpp b/ApplicationLibCode/ProjectDataModel/RimEclipseResultCase.cpp index 950bee76f7e..9eb025a0fdf 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEclipseResultCase.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEclipseResultCase.cpp @@ -498,6 +498,13 @@ cvf::ref RimEclipseResultCase::createMockModel( QString mode //-------------------------------------------------------------------------------------------------- RimEclipseResultCase::~RimEclipseResultCase() { + // Disconnect all comparison views. In debug build on Windows, a crash occurs. The comparison view is also set to zero in the destructor + // of Rim3dView() + for ( auto v : reservoirViews ) + { + if ( v ) v->setComparisonView( nullptr ); + } + reservoirViews.deleteChildren(); m_flowDiagSolutions.deleteChildren(); }