(#579) Removing well log extractors with case references in case destructors

This commit is contained in:
Pål Hagen
2015-10-22 14:26:54 +02:00
parent eb9f909fb1
commit 52f1e47576
3 changed files with 38 additions and 26 deletions

View File

@@ -24,6 +24,9 @@
#include "RifOdbReader.h"
#include "RigGeoMechCaseData.h"
#include "RigFemPartResultsCollection.h"
#include "RimProject.h"
#include "RimMainPlotCollection.h"
#include "RimWellLogPlotCollection.h"
#include <QFile>
@@ -47,6 +50,25 @@ RimGeoMechCase::RimGeoMechCase(void)
RimGeoMechCase::~RimGeoMechCase(void)
{
geoMechViews.deleteAllChildObjects();
RimProject* project = RiaApplication::instance()->project();
if (project)
{
if (project->mainPlotCollection())
{
RimWellLogPlotCollection* plotCollection = project->mainPlotCollection()->wellLogPlotCollection();
if (plotCollection)
{
plotCollection->removeExtractors(this->geoMechData());
}
}
}
if (this->geoMechData())
{
// At this point, we assume that memory should be released
CVF_ASSERT(this->geoMechData()->refCount() == 1);
}
}
//--------------------------------------------------------------------------------------------------