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:
@@ -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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user