mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5007 Janitor : Do not call virtual methods from destructors
This commit is contained in:
@@ -226,7 +226,7 @@ RimSummaryPlot::~RimSummaryPlot()
|
||||
{
|
||||
removeMdiWindowFromMdiArea();
|
||||
|
||||
deleteViewWidget();
|
||||
cleanupBeforeClose();
|
||||
|
||||
m_summaryCurves_OBSOLETE.deleteAllChildObjects();
|
||||
m_curveFilters_OBSOLETE.deleteAllChildObjects();
|
||||
@@ -1508,6 +1508,35 @@ std::set<RimPlotAxisPropertiesInterface*> RimSummaryPlot::allPlotAxes() const
|
||||
return {m_timeAxisProperties, m_bottomAxisProperties, m_leftYAxisProperties, m_rightYAxisProperties};
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::cleanupBeforeClose()
|
||||
{
|
||||
if ( m_summaryCurveCollection )
|
||||
{
|
||||
m_summaryCurveCollection->detachQwtCurves();
|
||||
}
|
||||
|
||||
m_ensembleCurveSetCollection->detachQwtCurves();
|
||||
|
||||
for ( RimGridTimeHistoryCurve* curve : m_gridTimeHistoryCurves )
|
||||
{
|
||||
curve->detachQwtCurve();
|
||||
}
|
||||
|
||||
for ( RimAsciiDataCurve* curve : m_asciiDataCurves )
|
||||
{
|
||||
curve->detachQwtCurve();
|
||||
}
|
||||
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
m_plotWidget->deleteLater();
|
||||
m_plotWidget = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1736,13 +1765,7 @@ QWidget* RimSummaryPlot::createViewWidget( QWidget* mainWindowParent )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::deleteViewWidget()
|
||||
{
|
||||
detachAllCurves();
|
||||
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
m_plotWidget->deleteLater();
|
||||
m_plotWidget = nullptr;
|
||||
}
|
||||
cleanupBeforeClose();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -224,6 +224,8 @@ private:
|
||||
|
||||
std::set<RimPlotAxisPropertiesInterface*> allPlotAxes() const;
|
||||
|
||||
void cleanupBeforeClose();
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_normalizeCurveYValues;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user