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:
@@ -87,7 +87,7 @@ RimGridCrossPlot::RimGridCrossPlot()
|
||||
RimGridCrossPlot::~RimGridCrossPlot()
|
||||
{
|
||||
removeMdiWindowFromMdiArea();
|
||||
deleteViewWidget();
|
||||
cleanupBeforeClose();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -481,12 +481,7 @@ QWidget* RimGridCrossPlot::createViewWidget( QWidget* mainWindowParent )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCrossPlot::deleteViewWidget()
|
||||
{
|
||||
detachAllCurves();
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
m_plotWidget->deleteLater();
|
||||
m_plotWidget = nullptr;
|
||||
}
|
||||
cleanupBeforeClose();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1115,6 +1110,23 @@ void RimGridCrossPlot::updatePlotTitle()
|
||||
updateCurveNamesAndPlotTitle();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCrossPlot::cleanupBeforeClose()
|
||||
{
|
||||
for ( auto dataSet : m_crossPlotDataSets() )
|
||||
{
|
||||
dataSet->detachAllCurves();
|
||||
}
|
||||
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
m_plotWidget->deleteLater();
|
||||
m_plotWidget = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Name Configuration
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user