mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix crash during delete of multiplot
This commit is contained in:
parent
386ba1cbac
commit
73d598ee7e
@ -45,6 +45,7 @@ CAF_PDM_SOURCE_INIT( RimMultiPlot, "MultiPlot" );
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimMultiPlot::RimMultiPlot()
|
||||
: m_isValid( true )
|
||||
{
|
||||
CAF_PDM_InitObject( "Multi Plot", ":/MultiPlot16x16.png" );
|
||||
|
||||
@ -84,6 +85,8 @@ RimMultiPlot::RimMultiPlot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimMultiPlot::~RimMultiPlot()
|
||||
{
|
||||
m_isValid = false;
|
||||
|
||||
removeMdiWindowFromMdiArea();
|
||||
m_plots.deleteAllChildObjects();
|
||||
|
||||
@ -897,3 +900,11 @@ std::vector<caf::PdmFieldHandle*> RimMultiPlot::fieldsToShowInToolbar()
|
||||
{
|
||||
return { &m_pagePreviewMode, &m_columnCount, &m_rowsPerPage };
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimMultiPlot::isValid() const
|
||||
{
|
||||
return m_isValid;
|
||||
}
|
||||
|
@ -107,6 +107,8 @@ public:
|
||||
|
||||
virtual std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
|
||||
|
||||
bool isValid() const;
|
||||
|
||||
protected:
|
||||
QImage snapshotWindowContent() override;
|
||||
|
||||
@ -169,4 +171,6 @@ protected:
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimPlot*> m_plots;
|
||||
|
||||
bool m_isValid;
|
||||
};
|
||||
|
@ -492,6 +492,8 @@ bool RiuMultiPlotBook::showYAxis( int row, int column ) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMultiPlotBook::performUpdate( bool regeneratePages )
|
||||
{
|
||||
if ( !m_plotDefinition || !m_plotDefinition->isValid() ) return;
|
||||
|
||||
applyLook();
|
||||
if ( regeneratePages || m_pages.size() == 0 )
|
||||
{
|
||||
|
@ -563,6 +563,9 @@ bool RiuMultiPlotPage::showYAxis( int row, int column ) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMultiPlotPage::performUpdate( RiaDefines::MultiPlotPageUpdateType whatToUpdate )
|
||||
{
|
||||
auto multiPlot = dynamic_cast<RimMultiPlot*>( m_plotDefinition.p() );
|
||||
if ( !multiPlot || !multiPlot->isValid() ) return;
|
||||
|
||||
if ( whatToUpdate == RiaDefines::MultiPlotPageUpdateType::ALL )
|
||||
{
|
||||
applyLook();
|
||||
|
Loading…
Reference in New Issue
Block a user