mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Regression Test: Do not access RimWellLogPlotCollection directly from desctructors
Regression tests are calling RimProject::reset(), and this function deletes the RimProject object.
This commit is contained in:
parent
4d244bc848
commit
c2ab9e6fe0
@ -98,7 +98,7 @@ void caf::AppEnum<RimGeoMechCase::InitialPermeabilityType>::setUp()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimGeoMechCase::RimGeoMechCase( void )
|
RimGeoMechCase::RimGeoMechCase()
|
||||||
: m_applyTimeFilter( false )
|
: m_applyTimeFilter( false )
|
||||||
{
|
{
|
||||||
CAF_PDM_InitScriptableObjectWithNameAndComment( "GeoMechanical Case",
|
CAF_PDM_InitScriptableObjectWithNameAndComment( "GeoMechanical Case",
|
||||||
@ -181,14 +181,21 @@ RimGeoMechCase::RimGeoMechCase( void )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimGeoMechCase::~RimGeoMechCase( void )
|
RimGeoMechCase::~RimGeoMechCase()
|
||||||
{
|
{
|
||||||
geoMechViews.deleteChildren();
|
geoMechViews.deleteChildren();
|
||||||
|
|
||||||
RimWellLogPlotCollection* plotCollection = RimMainPlotCollection::current()->wellLogPlotCollection();
|
RimProject* project = RimProject::current();
|
||||||
if ( plotCollection )
|
if ( project )
|
||||||
{
|
{
|
||||||
plotCollection->removeExtractors( this->geoMechData() );
|
if ( project->mainPlotCollection() )
|
||||||
|
{
|
||||||
|
RimWellLogPlotCollection* plotCollection = project->mainPlotCollection()->wellLogPlotCollection();
|
||||||
|
if ( plotCollection )
|
||||||
|
{
|
||||||
|
plotCollection->removeExtractors( this->geoMechData() );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( this->geoMechData() )
|
if ( this->geoMechData() )
|
||||||
|
@ -67,8 +67,9 @@ public:
|
|||||||
INITIAL_PERMEABILITY_PER_ELEMENT
|
INITIAL_PERMEABILITY_PER_ELEMENT
|
||||||
};
|
};
|
||||||
|
|
||||||
RimGeoMechCase( void );
|
RimGeoMechCase();
|
||||||
~RimGeoMechCase( void ) override;
|
|
||||||
|
~RimGeoMechCase() override;
|
||||||
|
|
||||||
CaseOpenStatus openGeoMechCase( std::string* errorMessage );
|
CaseOpenStatus openGeoMechCase( std::string* errorMessage );
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "RigHexIntersectionTools.h"
|
#include "RigHexIntersectionTools.h"
|
||||||
|
|
||||||
#include "RimCellFilterCollection.h"
|
#include "RimCellFilterCollection.h"
|
||||||
|
#include "RimGeoMechCase.h"
|
||||||
#include "RimGeoMechCellColors.h"
|
#include "RimGeoMechCellColors.h"
|
||||||
#include "RimGeoMechContourMapView.h"
|
#include "RimGeoMechContourMapView.h"
|
||||||
#include "RimGeoMechPropertyFilterCollection.h"
|
#include "RimGeoMechPropertyFilterCollection.h"
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
|
|
||||||
#include "RimCheckableNamedObject.h"
|
#include "RimCheckableNamedObject.h"
|
||||||
#include "RimContourMapProjection.h"
|
#include "RimContourMapProjection.h"
|
||||||
#include "RimGeoMechCase.h"
|
|
||||||
|
|
||||||
#include "cafDisplayCoordTransform.h"
|
#include "cafDisplayCoordTransform.h"
|
||||||
#include "cafPdmChildField.h"
|
#include "cafPdmChildField.h"
|
||||||
@ -37,6 +36,7 @@
|
|||||||
#include "cvfVector2.h"
|
#include "cvfVector2.h"
|
||||||
|
|
||||||
class RimGeoMechContourMapView;
|
class RimGeoMechContourMapView;
|
||||||
|
class RimGeoMechCase;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
|
@ -152,10 +152,17 @@ RimEclipseCase::~RimEclipseCase()
|
|||||||
delete m_fractureModelResults();
|
delete m_fractureModelResults();
|
||||||
delete m_inputPropertyCollection;
|
delete m_inputPropertyCollection;
|
||||||
|
|
||||||
RimWellLogPlotCollection* plotCollection = RimMainPlotCollection::current()->wellLogPlotCollection();
|
RimProject* project = RimProject::current();
|
||||||
if ( plotCollection )
|
if ( project )
|
||||||
{
|
{
|
||||||
plotCollection->removeExtractors( this->eclipseCaseData() );
|
if ( project->mainPlotCollection() )
|
||||||
|
{
|
||||||
|
RimWellLogPlotCollection* plotCollection = project->mainPlotCollection()->wellLogPlotCollection();
|
||||||
|
if ( plotCollection )
|
||||||
|
{
|
||||||
|
plotCollection->removeExtractors( this->eclipseCaseData() );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( this->eclipseCaseData() )
|
if ( this->eclipseCaseData() )
|
||||||
|
@ -160,6 +160,8 @@ RimMainPlotCollection::~RimMainPlotCollection()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimMainPlotCollection* RimMainPlotCollection::current()
|
RimMainPlotCollection* RimMainPlotCollection::current()
|
||||||
{
|
{
|
||||||
|
CVF_ASSERT( RimProject::current() );
|
||||||
|
|
||||||
return RimProject::current()->mainPlotCollection();
|
return RimProject::current()->mainPlotCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user