mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Use deleteChildren() when required to avoid memory leak
This commit is contained in:
@@ -238,7 +238,7 @@ std::vector<RifEclipseSummaryAddress> RimEnsembleCurveFilter::summaryAddresses()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleCurveFilter::setSummaryAddresses( std::vector<RifEclipseSummaryAddress> addresses )
|
||||
{
|
||||
m_objectiveValuesSummaryAddresses.clearWithoutDelete();
|
||||
m_objectiveValuesSummaryAddresses.deleteChildren();
|
||||
for ( auto address : addresses )
|
||||
{
|
||||
RimSummaryAddress* summaryAddress = new RimSummaryAddress();
|
||||
@@ -396,7 +396,7 @@ void RimEnsembleCurveFilter::fieldChangedByUi( const caf::PdmFieldHandle* change
|
||||
auto curveSelection = dlg.curveSelection();
|
||||
if ( !curveSelection.empty() )
|
||||
{
|
||||
m_objectiveValuesSummaryAddresses.clearWithoutDelete();
|
||||
m_objectiveValuesSummaryAddresses.deleteChildren();
|
||||
for ( auto address : curveSelection )
|
||||
{
|
||||
RimSummaryAddress* summaryAddress = new RimSummaryAddress();
|
||||
|
||||
@@ -820,7 +820,7 @@ void RimEnsembleCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
|
||||
auto curveSelection = dlg.curveSelection();
|
||||
if ( !curveSelection.empty() )
|
||||
{
|
||||
m_objectiveValuesSummaryAddresses.clearWithoutDelete();
|
||||
m_objectiveValuesSummaryAddresses.deleteChildren();
|
||||
for ( auto address : curveSelection )
|
||||
{
|
||||
RimSummaryAddress* summaryAddress = new RimSummaryAddress();
|
||||
|
||||
@@ -532,7 +532,7 @@ void RimSummaryTimeAxisProperties::appendAnnotation( RimPlotAxisAnnotation* anno
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryTimeAxisProperties::removeAllAnnotations()
|
||||
{
|
||||
m_annotations.clearWithoutDelete();
|
||||
m_annotations.deleteChildren();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user