mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #5277 from OPM/guard-null-pointer-access
Ensemble : Guard null pointer access causing crash
This commit is contained in:
commit
5bcaed594b
@ -185,7 +185,10 @@ RimEnsembleCurveSet::~RimEnsembleCurveSet()
|
|||||||
if ( parentPlot && parentPlot->viewer() )
|
if ( parentPlot && parentPlot->viewer() )
|
||||||
{
|
{
|
||||||
m_qwtPlotCurveForLegendText->detach();
|
m_qwtPlotCurveForLegendText->detach();
|
||||||
parentPlot->viewer()->removeOverlayFrame( m_legendOverlayFrame );
|
if ( m_legendOverlayFrame )
|
||||||
|
{
|
||||||
|
parentPlot->viewer()->removeOverlayFrame( m_legendOverlayFrame );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ( m_legendOverlayFrame )
|
if ( m_legendOverlayFrame )
|
||||||
{
|
{
|
||||||
|
@ -1232,7 +1232,7 @@ void RimSummaryPlot::deleteCurves( const std::vector<RimSummaryCurve*>& curves )
|
|||||||
if ( curveSet->curves().empty() )
|
if ( curveSet->curves().empty() )
|
||||||
{
|
{
|
||||||
if ( curveSet->colorMode() == RimEnsembleCurveSet::ColorMode::BY_ENSEMBLE_PARAM &&
|
if ( curveSet->colorMode() == RimEnsembleCurveSet::ColorMode::BY_ENSEMBLE_PARAM &&
|
||||||
m_plotWidget )
|
m_plotWidget && curveSet->legendFrame() )
|
||||||
{
|
{
|
||||||
m_plotWidget->removeOverlayFrame( curveSet->legendFrame() );
|
m_plotWidget->removeOverlayFrame( curveSet->legendFrame() );
|
||||||
}
|
}
|
||||||
|
@ -426,6 +426,8 @@ void RiuQwtPlotWidget::addOverlayFrame( RiuDraggableOverlayFrame* overlayFrame )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuQwtPlotWidget::removeOverlayFrame( RiuDraggableOverlayFrame* overlayFrame )
|
void RiuQwtPlotWidget::removeOverlayFrame( RiuDraggableOverlayFrame* overlayFrame )
|
||||||
{
|
{
|
||||||
|
CAF_ASSERT( overlayFrame );
|
||||||
|
|
||||||
overlayFrame->hide();
|
overlayFrame->hide();
|
||||||
overlayFrame->setParent( nullptr );
|
overlayFrame->setParent( nullptr );
|
||||||
m_overlayFrames.removeOne( overlayFrame );
|
m_overlayFrames.removeOne( overlayFrame );
|
||||||
|
Loading…
Reference in New Issue
Block a user