#9156 Use PdmPointer to avoid dangling pointer in Plot Editor

This commit is contained in:
Magne Sjaastad 2022-08-04 13:15:02 +02:00
parent 82f6dc74c1
commit 824d5bd458
2 changed files with 5 additions and 2 deletions

View File

@ -164,7 +164,10 @@ void RicSummaryPlotEditorUi::updateFromSummaryPlot( RimSummaryPlot*
if ( m_targetPlot )
{
targetPlot->firstAncestorOfType( m_plotContainer );
RimSummaryMultiPlot* parentPlot = nullptr;
targetPlot->firstAncestorOfType( parentPlot );
m_plotContainer = parentPlot;
populateCurveCreator( *m_targetPlot );
syncPreviewCurvesFromUiSelection();
setInitialCurveVisibility( targetPlot );

View File

@ -134,5 +134,5 @@ private:
std::unique_ptr<RiuSummaryVectorSelectionWidgetCreator> m_summaryCurveSelectionEditor;
RimSummaryMultiPlot* m_plotContainer;
caf::PdmPointer<RimSummaryMultiPlot> m_plotContainer;
};