mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
SSIHUB: Fixed memory leak
Delete copy of RimWellPathImport object and added destructor to related objects
This commit is contained in:
parent
785efe55e8
commit
cbe9110c8a
@ -1657,11 +1657,11 @@ void RiuMainWindow::slotImportWellPathsFromSSIHub()
|
||||
|
||||
wellPathsFolderPath += "/" + wellPathFolderName;
|
||||
|
||||
|
||||
RimWellPathImport* copyOfWellPathImport = dynamic_cast<RimWellPathImport*>(app->project()->wellPathImport->deepCopy());
|
||||
|
||||
RiuWellImportWizard wellImportwizard(app->preferences()->ssihubAddress, wellPathsFolderPath, copyOfWellPathImport, this);
|
||||
|
||||
|
||||
RimWellPathImport* wellPathObjectToBeDeleted = NULL;
|
||||
|
||||
// Get password/username from application cache
|
||||
{
|
||||
QString ssihubUsername = app->cacheDataObject("ssihub_username").toString();
|
||||
@ -1679,11 +1679,18 @@ void RiuMainWindow::slotImportWellPathsFromSSIHub()
|
||||
app->project()->createDisplayModelAndRedrawAllViews();
|
||||
}
|
||||
|
||||
wellPathObjectToBeDeleted = app->project()->wellPathImport;
|
||||
app->project()->wellPathImport = copyOfWellPathImport;
|
||||
|
||||
app->setCacheDataObject("ssihub_username", wellImportwizard.field("username"));
|
||||
app->setCacheDataObject("ssihub_password", wellImportwizard.field("password"));
|
||||
}
|
||||
else
|
||||
{
|
||||
wellPathObjectToBeDeleted = copyOfWellPathImport;
|
||||
}
|
||||
|
||||
delete wellPathObjectToBeDeleted;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -48,6 +48,14 @@ RimOilFieldEntry::RimOilFieldEntry()
|
||||
CAF_PDM_InitFieldNoDefault(&wells, "Wells", "", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimOilFieldEntry::~RimOilFieldEntry()
|
||||
{
|
||||
wells.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -116,4 +124,3 @@ RimWellPathEntry* RimOilFieldEntry::find(const QString& name, RimWellPathEntry::
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,7 @@ class RimOilFieldEntry : public caf::PdmObject
|
||||
|
||||
public:
|
||||
RimOilFieldEntry();
|
||||
~RimOilFieldEntry();
|
||||
|
||||
|
||||
caf::PdmField<QString> name;
|
||||
|
@ -38,6 +38,14 @@ RimOilRegionEntry::RimOilRegionEntry()
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimOilRegionEntry::~RimOilRegionEntry()
|
||||
{
|
||||
fields.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -77,5 +85,3 @@ void RimOilRegionEntry::updateState()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -32,6 +32,7 @@ class RimOilRegionEntry : public caf::PdmObject
|
||||
|
||||
public:
|
||||
RimOilRegionEntry();
|
||||
~RimOilRegionEntry();
|
||||
|
||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
||||
virtual caf::PdmFieldHandle* objectToggleField();
|
||||
|
@ -201,5 +201,13 @@ void RimWellPathImport::defineObjectEditorAttribute(QString uiConfigName, caf::P
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathImport::~RimWellPathImport()
|
||||
{
|
||||
regions.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
|
||||
public:
|
||||
RimWellPathImport();
|
||||
~RimWellPathImport();
|
||||
|
||||
caf::PdmField<bool> wellTypeSurvey;
|
||||
caf::PdmField<bool> wellTypePlans;
|
||||
|
Loading…
Reference in New Issue
Block a user