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:
parent
950ec38a14
commit
6a5b9f7300
@ -1117,7 +1117,7 @@ void WellSummaryPage::initializePage()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void WellSummaryPage::updateSummaryPage()
|
||||
{
|
||||
m_objectGroup->objects.clearWithoutDelete();
|
||||
m_objectGroup->objects.deleteChildren();
|
||||
|
||||
m_textEdit->setText( "Summary of imported wells\n\n" );
|
||||
|
||||
|
@ -270,7 +270,7 @@ void RimFaultRASettings::initFromPreprocSettings( RimFaultRAPreprocSettings* pre
|
||||
RifParameterXmlReader basicreader( RiaPreferencesGeoMech::current()->geomechFRADefaultBasicXML() );
|
||||
if ( !basicreader.parseFile( errorText ) ) return;
|
||||
|
||||
m_basicParameters.clearWithoutDelete();
|
||||
m_basicParameters.deleteChildren();
|
||||
for ( auto group : basicreader.parameterGroups() )
|
||||
{
|
||||
m_basicParameters.push_back( group );
|
||||
@ -281,7 +281,7 @@ void RimFaultRASettings::initFromPreprocSettings( RimFaultRAPreprocSettings* pre
|
||||
RifParameterXmlReader advreader( RiaPreferencesGeoMech::current()->geomechFRADefaultAdvXML() );
|
||||
if ( !advreader.parseFile( errorText ) ) return;
|
||||
|
||||
m_advancedParameters.clearWithoutDelete();
|
||||
m_advancedParameters.deleteChildren();
|
||||
for ( auto group : advreader.parameterGroups() )
|
||||
{
|
||||
m_advancedParameters.push_back( group );
|
||||
|
@ -1045,7 +1045,7 @@ void RimWellPltPlot::initAfterLoad()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPltPlot::syncSourcesIoFieldFromGuiField()
|
||||
{
|
||||
m_selectedSourcesForIo.clearWithoutDelete();
|
||||
m_selectedSourcesForIo.deleteChildren();
|
||||
|
||||
for ( const RifDataSourceForRftPlt& addr : m_selectedSources() )
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ void RimGeoMechPartCollection::syncWithCase( RimGeoMechCase* geoCase )
|
||||
|
||||
if ( count != (int)m_parts.size() )
|
||||
{
|
||||
m_parts.clearWithoutDelete();
|
||||
m_parts.deleteChildren();
|
||||
|
||||
for ( int i = 0; i < count; i++ )
|
||||
{
|
||||
|
@ -167,7 +167,7 @@ void RimCustomObjectiveFunctionWeight::fieldChangedByUi( const caf::PdmFieldHand
|
||||
auto curveSelection = dlg.curveSelection();
|
||||
if ( !curveSelection.empty() )
|
||||
{
|
||||
m_objectiveValuesSummaryAddresses.clearWithoutDelete();
|
||||
m_objectiveValuesSummaryAddresses.deleteChildren();
|
||||
for ( auto address : curveSelection )
|
||||
{
|
||||
RimSummaryAddress* summaryAddress = new RimSummaryAddress();
|
||||
|
@ -425,7 +425,7 @@ void RimPlotAxisProperties::appendAnnotation( RimPlotAxisAnnotation* annotation
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotAxisProperties::removeAllAnnotations()
|
||||
{
|
||||
m_annotations.clearWithoutDelete();
|
||||
m_annotations.deleteChildren();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -441,7 +441,7 @@ void RimStreamlineInViewCollection::updateStreamlines()
|
||||
if ( m_shouldGenerateTracers && isActive() )
|
||||
{
|
||||
// reset generated streamlines
|
||||
m_streamlines().clearWithoutDelete();
|
||||
m_streamlines.deleteChildren();
|
||||
m_wellCellIds.clear();
|
||||
|
||||
// get current simulation timestep
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -116,7 +116,7 @@ bool RimWellIASettings::initSettings( QString& outErrmsg )
|
||||
RifParameterXmlReader basicreader( RiaPreferencesGeoMech::current()->geomechWIADefaultXML() );
|
||||
if ( !basicreader.parseFile( outErrmsg ) ) return false;
|
||||
|
||||
m_parameters.clearWithoutDelete();
|
||||
m_parameters.deleteChildren();
|
||||
for ( auto group : basicreader.parameterGroups() )
|
||||
{
|
||||
m_parameters.push_back( group );
|
||||
@ -525,7 +525,7 @@ void RimWellIASettings::addCsvGroup( QString name, QStringList timeSteps, double
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellIASettings::initCsvParameters()
|
||||
{
|
||||
m_csvParameters.clearWithoutDelete();
|
||||
m_csvParameters.deleteChildren();
|
||||
|
||||
QStringList timeSteps = m_geomechCase->timeStepStrings();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user