mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
WellLogPath. Fix memory leak
This commit is contained in:
@@ -53,7 +53,7 @@ void RicWellLogFileCloseFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
if (parentWellPath != nullptr)
|
||||
{
|
||||
parentWellPath->removeWellLogFile(wellLogFile);
|
||||
parentWellPath->deleteWellLogFile(wellLogFile);
|
||||
}
|
||||
parentWellPath->updateConnectedEditors();
|
||||
}
|
||||
|
||||
@@ -653,13 +653,14 @@ void RimWellPath::addWellLogFile(RimWellLogFile* logFileInfo)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPath::removeWellLogFile(const RimWellLogFile* logFileInfo)
|
||||
void RimWellPath::deleteWellLogFile(RimWellLogFile* logFileInfo)
|
||||
{
|
||||
auto pdmObject = dynamic_cast<caf::PdmObjectHandle*>(logFileInfo);
|
||||
for (size_t i = 0; i < m_wellLogFiles.size(); i++)
|
||||
{
|
||||
if (m_wellLogFiles[i] == logFileInfo)
|
||||
if (m_wellLogFiles[i] == pdmObject)
|
||||
{
|
||||
m_wellLogFiles.erase(i);
|
||||
m_wellLogFiles.removeChildObject(pdmObject);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
virtual ~RimWellPath();
|
||||
|
||||
void addWellLogFile(RimWellLogFile* logFileInfo);
|
||||
void removeWellLogFile(const RimWellLogFile* logFileInfo);
|
||||
void deleteWellLogFile(RimWellLogFile* logFileInfo);
|
||||
|
||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
||||
virtual caf::PdmFieldHandle* objectToggleField();
|
||||
|
||||
Reference in New Issue
Block a user